Click to See Complete Forum and Search --> : DNS & hosts file-dumb question


TongueTied
08-14-2002, 01:43 AM
Sorry about this one, but I am slowly learning this stuff.

Do you need to enter all clients and ips in the hosts file if you also have a DNS running?

Using SuSE 7.3, I have set up a DNS and it seems to be working. I can use nslookup and query hosts. No error messages in the messages file (/var/log/messages). I have tryed the follwing two scenarios:

1. hosts file has all ip addresses and client names for the network,
-Typed in "nslookup machine1" from any windows client on the network
-Result is:
"Server: server.domain
Address: 192.168.1.1

Name: machine1.domain
Address 192.168.1.100"


2. hosts file does NOT have all ip addresses and client names for the network,
-Typed in "nslookup machine1" from any windows client on the network
-Result is:
"Server: server.domain
Address: 192.168.1.1

***machine1.domain can't find machine1: Non-existant domain"

Using nslookup to query hosts outside my network such as www.linuxnewbie.org works regardless of what is in the hosts file.

So, is there something strange going on or is it just the hosts file issue and if a DNS is working properly and all hosts are listed in your zone files, do you still need a "hosts" file?

Philip

Lorithar
08-14-2002, 10:36 AM
In the case of a small home lan using static IP's it is truely easier to use the /etc/hosts file.

DNS uses 'zones' which require that you setup a file to include the host/ip information for that zone... In this case your lan would be a 'zone'. The information required is substantially more complex than that required by /etc/hosts.

What you are seeing is the results of /etc/resolv.conf including the statement
multi on
and
order hosts, bind
or
order bind, hosts.

/etc/resolv.conf tells your server *how* to resolve names, and in which order. Without the *multi* statement it will use either hosts or BIND but not both. The order statement tells the server which to check first.

cowanrl
08-14-2002, 11:45 AM
Shouldn't the order and multi settings go in /etc/host.conf, not /etc/resolv.conf?

TongueTied
08-14-2002, 11:40 PM
I have set up the DNS and it seems to work quite well except for the error mentioned at the beginning of this thread. Both forward and reverse zone files are set up and there are no error messages in the /var/log/messages file. I should also mention that I don't get the error message if the nslookup command is run from the Linux server, only when it is run from the network clients.

I have switched the order of the lookup in hosts.conf, made sure that the "muti" line was set to "on" and restarted everything. I still get the same error message.

Could it be something on the client machines? Do you need to tell a Win2K machine that it should look to the DNS for local network name resolution and not rely on the hosts file on the DNS server?

Philip

TongueTied
08-15-2002, 02:38 AM
Solved!

The issue is not a problem with Linux but with Extrasoft Windows. In win2k, you need to go to the Network Identification, Properties, More window and write in the primary domain suffix as well as setting the system to append the domain suffix in the normal lan settings. If you only deal with the domain suffix in the network connection properties, it will give you the error I mentioened previously.

Thanks for you input.
Philip