1833704 Members
2676 Online
110062 Solutions
New Discussion

nslookup hostname fails.

 
ben_43
Frequent Advisor

nslookup hostname fails.

Team:

nslookup hostname fails, while nslookup hostname.domain.com succeeds. nsswitch.conf is set to look into dns first and then files. resolv.conf is fine. The box has the latest BIND patches and the version of nslookup is 1.1.214.3(what nslookup). Any ideas??

Thanks
Ben.
5 REPLIES 5
Patrick Wallek
Honored Contributor

Re: nslookup hostname fails.

What does your resolv.conf file look like?

# cat /etc/resolv.conf
domain abc.com
nameserver 123.45.67.89


If you don't have the domain as the first line in your /etc/resolv.conf then add it in.

You may also want to look at the searchorder line in the resolv.conf man page.

# man resolv.conf
Rita C Workman
Honored Contributor

Re: nslookup hostname fails.

You failed at two level..dns and files.

You need to check in named.boot and /etc/hosts, you may have a typo..

By the way....did it resolve properly based on IP??

Just a quick thought,
Rita
Uday_S_Ankolekar
Honored Contributor

Re: nslookup hostname fails.

Next I would check the configuration on DNS server itself. Is the DNS database has qualified doamin name properly??

check in /etc/named.data directory .

-USA..
Good Luck..
Hai Nguyen_1
Honored Contributor

Re: nslookup hostname fails.

Ben,

Verify that you do have a "domain" line in /etc/resolv.conf. Then the command "nslookup hostname" will work only if its domain name is the same as the one specified in /etc/resolv.conf.

If your hostname shares the same domain name mentioned in /etc/resolv.conf and nslookup could not resolve the hostname then the problem is in your dns data/configuration files.

Hai
Bill Hassell
Honored Contributor

Re: nslookup hostname fails.

Your system name (without a fully qualified domain name or FQDN) will be searched by your DNS server as part of the DNS server's domain unless you specify a local domain in resolv.conf. Start by reversing file and dns. That should resolve just fine. If not, fix /etc/hosts. Also make sure that the hosts line in nsswitch.conf reads:

hosts: dns files

The default criteria are to continue on anything except SUCCESS;
in other words, [SUCCESS=return NOTFOUND=continue UNAVAIL=continue TRYAGAIN=continue].

nslookup will report each source as it tries. So for dns then files, you'll see the lookup for DNS first (which will probably fail, followed by FILES which is /etc/hosts.


Bill Hassell, sysadmin