Click to See Complete Forum and Search --> : /etc/hosts vs. DNS


sclebo05
09-24-2003, 12:30 PM
i posted a few days ago about a samba client on my slack9 box not finding any other machines on my network. i found this odd because my RH9 box could easily smbclient -N -L //boxname .............and they have the same smb.conf!

on a whim, i added the hostnames of all the boxes to my /etc/hosts and now i can samba connect with ease. my question is, why is my RH box doing it automatically and my slack box requiring manual editing of a file? if i add 100 more PCs to the network, i would have to add 100 lines to /etc/hosts :rolleyes:

second part of this: when i run netconfig on my slack box and don't use a DNS, samba works - internet doesn't. when i turn DNS on, i get internet but no samba. what gives? are all my problems name resolution based? how do i fix this (other than the way i did)

and why the HECK does my RH box do it automatically and my slack box not?

l01yuk
09-24-2003, 02:06 PM
What do your /etc/resolv.conf files look like on each machine?

You shouldn't have to fill the /etc/hosts file if you are pointing towards a DNS server with the entries of your machines on.

When you say 'turn DNS on' do you mean the server? You won't need the servers started on these machines (unless one of them is the DNS server you need to be pointing at of course) so you can turn them off. You will be querying a DNS server as a client but they shouldn't be set up as servers themselves.

sclebo05
09-24-2003, 04:55 PM
thanks a lot man. you helped me fix it!

here is what i found............


my resolv.conf on the working machine just had

nameserver 192.168.x.x which is my router. my instructions for my router said that for dns i needed to do that.

on the trouble machine, the resolv.conf has:

search sclebo.net
nameserver 192.168.x.x


i had entered sclebo.net because the slack netconfig demanded a domain. i commented out the 'search sclebo.net' and everything worked fine as if by magic. i guess the machine was searching for sclebo.net on the internet, and my arbitrary domain was messing it up. what should i put in there. localdomain?

thanks again.

l01yuk
09-25-2003, 07:20 AM
You should have
nameserver <ip> <-up to 3 of these
domain <dns domain name>

I would leave the search option out because it can be slow.

Glad to have helped :)