Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

I'm new to networking in depth, I may ask silly questions. I hope you can point me in some right direction.

Info

I have a Belkin N 150 wireless ADSL router that also acts as a wireless hub. I have these PC's connected to it:

  • wired Ubuntu 10.10 Maverick (HTPC)
  • wireless Ubuntu 10.04 Lucid (desktop)
  • Wireless Crunchbang linux (netbook)
  • wireless Windows 7 laptop (housemate)

There may be more, like if friends/my sister visits.

The router has DHCP enabled, each PC gets an IP address, and access outside/net. It is a secured network.

Goal

Setup samba shares on the HTPC accessible (via hostname ie \\htpc or smb://htpc) by all PC's (Ubuntu/Windows) on the network - and also by whoever else I give access to the network.

Problem

I can't ping between the PC's by hostname, only by IP address. Hostnames don't resolve. I managed to setup samba shares and could access them by IP, and for a short while by hostname, but then things went wonky. I must have messed somthing up, I can't say what :(

Now my shares don't work, and I can only ping by IP. I can also ssh into the HTPC fine, but only via IP address.

The firewalls on both ends are disabled while I am troubleshooting this. I did ufw reset on the HTPC (with the samba shares) too.

I tried

  • adding wins into /etc/nsswitch.conf. I made sure to place it before the dns entry.
  • configure static IP's on the router, so I can add /etc/hosts entries to fix the dns/hostname resolve issue, but then I could not get outside/net access.

I need to reset everything and start again, this is driving me bonkers for a few weeks now - networking is new to me :) - I suspect I'm getting confused here with unreleated issues (dns resolving vs static/outside access vs samba access)

I searched ubuntuforums.org, serverfault and Google. Usually I can solve issues myself with enough time and searching, but now I suffer from info overload, and want to restart.

Which steps do I take first? Any tuts I can follow (tried a few, no luck)? What can I try to setup these:

  • wireless network, DHCP, with working hostname resolution
  • samba shares on the Ubuntu HTPC

Ideally I want to enable the firewall on all PC's too, but as I said they're disabled while troubleshooting.

Thanks for reading my question :)

share|improve this question
    
I did the following to be able to ping windows boxes by computername. I don't know it works the other way round, too. But you can give it a try. Install winbind sudo apt-get install winbind and edit your hosts line in the /etc/nsswitch.conffile to use wins. Like hosts: files wins mdns4_minimal NOTFOUND=return] dns mdns4 I think the wins hast to come before the dns stuff. Just add it in your file, or move it before the dns. Your line has not to look exactly like mine. –  Darokthar Feb 22 '11 at 7:57
    
I have done this @Darokthar as my 1st point where I posted what I tried. Mine reads: hosts: files wins mdns4_minimal [NOTFOUND=return] dns mdns4 –  invert Feb 22 '11 at 20:21
    
Have you logged in on the Belkin router and looked up the host names on the DHCP client list? And afterwards tried to ping the hosts by name? Like seen on page 39 (Page 41 of .pdf file) of the manual at: en-us-support.belkin.com/app/answers/detail/a_id/315 –  Darokthar Feb 22 '11 at 21:08
    
@Darokthar yes I do use the router config page to check hostnames. each PC does get a valid IP address, and yes I can ping between PC's by IP address. Just not by hostname / hostname.local –  invert Feb 23 '11 at 5:30

1 Answer 1

up vote 0 down vote accepted

Wireless Networks won't interfere with your network. Ones you can ping the different hosts on their IP address they are fine and wireless is connected correctly. Just take care of some type of encryption, everything below WPA2 is already easily cracked, therefore I suggest to use WPA2-Personal with a long enough key.

For DHCP I would use your router, they normaly have DHCP build in. There it's simple to configure.

For your name resolution, DNS can be used, but normally windows uses NetBIOS Names to emulate a simple DNS System. Also samba has this system integrated. In Ubuntu you need to install samba

sudo apt-get install samba

or try to create a shared folder in the Filebrowser, then it will ask you to install all the necessary packages.

Check also Places->Network in the FileBrowser, you should find the other computers there.

If you still get problems there some more steps you can do. If you can't resolve the hostnames of the linux computers on the windows or linux computers, it could be that nmbd is not started, to check this, try

sudo service nmbd start 

check again if it is working then.

If the problem is only on the linux computers, the problem could be that the order the computer is resolving names is wrong, and your internet provider offers a DNS response for not found searches. Then you have to change the line in /etc/samba/smb.conf

name resolve order = lmhosts host wins bcast

and move lmhosts behind bcast.

name resolve order = host wins bcast lmhosts

I hope it will help.

share|improve this answer
    
samba is already installed on both sides. I will change the name resolve order and see if that works. I hope that works... –  invert Feb 23 '11 at 5:33
    
that seems to have fixed it! I can ping by hostname now, and I can browse the samba shares via \\hostname too. Thanks! :) –  invert Feb 23 '11 at 20:19

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.