How to setup nslookups, queries using /etc/hosts as the default
Hello,
I am trying to setup so my server uses /etc/hosts as the default lookup method before DNS. I've changed /etc/nsswitch.conf (files dns) order but it doesn't work. Any other ideas? thanks. |
dns with hosts.conf
Hi,
when I get you right you are looking for /etc/hosts.conf Insert or uncomment the entry server=local,bind This statements specifies a server program that inquires for a name or address to first look into /etc/hosts and then use NIS bind. cheers Martin |
host.conf
Thanks. I added this to the host.conf, it now looks like this:
Do I need to reboot or reread these files as it still looks at DNS first. order hosts,bind server=local,bind |
I doubt that u can force nslookup to use /etc/hosts file. dig can i think . or try "getent" which is used to read diff DB like passwd and hosts.. but lets say what experts needs to say
|
nslookup performs its own resolving, and does not/will not uses /etc/hosts.
Also learn about /etc/nsswitch.conf |
All times are GMT -5. The time now is 10:16 PM. |