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 thedns
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 :)
sudo apt-get install winbind
and edit your hosts line in the/etc/nsswitch.conf
file to use wins. Likehosts: 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.hosts: files wins mdns4_minimal [NOTFOUND=return] dns mdns4