1837112 Members
2166 Online
110112 Solutions
New Discussion

Re: nslookup

 
SOLVED
Go to solution
Bill Pontius
Frequent Advisor

nslookup

On a 10.20 c110 box, when I enter nslookup, I get # nslookup
*** Can't find server name for address 192.168.1.2: Non-existent domain
*** Default servers are not available
Using /etc/hosts on: fredin

What is the problem with DNS that is not allowing it to resolve the inquery?
so let it be wriiten so let it be done
4 REPLIES 4
Uday_S_Ankolekar
Honored Contributor

Re: nslookup

Check Nsswitch.conf in etc . You will find entry for DNS to look first etc/hosts or DNS files. Change it for DNS then to look for /etc/hosts file
Hope this helps
Good Luck..
Patrick Wallek
Honored Contributor

Re: nslookup

You might also check your /etc/resolv.conf file to make sure that your domain name and nameservers are specified correctly.
Jim Turner
HPE Pro
Solution

Re: nslookup

Bill,

1. Make sure your /etc/hosts file has your machine's hostname and IP address listed correctly. Both should agree with what you have in /etc/rc.config.d/netconf for hostname and IP address.

2. Make sure your /etc/resolv.conf file has the following entries:
domain foo.com
nameserver 1.2.3.4
nameserver 5.6.7.7
where "foo.com" is your domain, and the nameserver(s) identified (max=3) are actually legitimate nameservers that are authoritative for your domain.

3. Make sure your /etc/nsswitch.conf file specifies DNS first (if that's what you want) then /etc/hosts. The contents of the file should look similar to this:
hosts: dns[NOTFOUND=continue UNAVAIL=continue] files[NOTFOUND=return UNAVAIL=return]

Cheers,
Jim
Bill Hassell
Honored Contributor

Re: nslookup

Actualy, this is a common problem with nslookup. When it is told to use DNS first, it will ask the IP address of DNS server: what is your name? Amazingly enough, many DNS administrators forget to give their server a name and enter it into the DNS database. In other words, the DNS server does not know it's own name.

One could argue that this is a security feature, that it prevents IP address spoofing.

So the fix is either: get your DNS server updated to report its hostname when queried about the IP address (reverse lookup).

Or, change your search policy as mentioned before to use hosts first. The latter is definitely preferred for network efficiency as well as speed. Put the most common IP addresses in your hosts file. The nslookup will use the server for everything else.


Bill Hassell, sysadmin