Operating System - HP-UX
1834639 Members
2659 Online
110069 Solutions
New Discussion

Slow "login" after adding DNS server entry into /etc/resolv.conf

 
SOLVED
Go to solution
Nick Wickens
Respected Contributor

Slow "login" after adding DNS server entry into /etc/resolv.conf

Yesterday I added an entry into /etc/resolv.conf to include our NT primary DNS server as a NAMESERVER. The only other entry in the resolv.conf file was a DOMAIN entry.

Everything was fine and I could happily ping away at other hosts not specified in /etc/hosts but now I find that pulling up a login screen takes an age unless I remove the NAMESERVER entry. I don't want to set my system hostname to the fully qualified domain entry listed in /etc/resolv.conf for other reasons.
Hats ? We don't need no stinkin' hats !!
5 REPLIES 5
Edward Sedgemore
Trusted Contributor

Re: Slow "login" after adding DNS server entry into /etc/resolv.conf


Normal config in resolv.conf is;

domain
nameserver

And your hostname set to: <8 chars>

You should not set your hostname to your fully qualified domainname (eg. <8 chars.domain>). No need to.
Have you got the standard
127.0.0.1 localhost loopback
entry in your /etc/hosts file ?

So with the above looking like it is and your server is slow then you need to look at your DNS server. Firstly, your brave using an NT box as your mission critical dns server. How is your /etc/nsswitch.conf file setup ? to look elsewhere if the DNS server doesnt reply ?
Look at the default nsswitch.conf files in /usr/newconfig/etc/nsswitch.*
You should be defaulting to files if your DNS server doesnt respond.

How fast is your dns server? if you continually do nslookup commands does it always reply nice and fast ? if not its a problem on your DNS box.
Nick Wickens
Respected Contributor

Re: Slow "login" after adding DNS server entry into /etc/resolv.conf

Thanks for the reply - have checked what you suggested and

(1) The resolv file just has two entries one for "Domain fred.co.uk" and one for "nameserver n.n.n.n" - You mention that the hostname should be here, do you mean just a new line with just the hostname or using the localdomain variable(I tried both but no success).
(2) Loop back IP address is in place in /etc/hosts.
(3) The nsswitch.conf file is correct (/etc/hosts then dns)
(4) nslookup searches /etc/host first and then dns before giving correct response and is instantaneous.

Any more help would be appreciated.
Hats ? We don't need no stinkin' hats !!
Edward Sedgemore
Trusted Contributor

Re: Slow "login" after adding DNS server entry into /etc/resolv.conf


You resolv.con file only should have 2 entries;

domain
nameserver

You can have multiple nameserver entries but only need one.

You said nslookup is instantaneous, this is great. So, we need to look elsewhere for your problem. Can you explain your problem in more detail please including specs on the HP server its on ?
Kenneth Platz
Esteemed Contributor
Solution

Re: Slow "login" after adding DNS server entry into /etc/resolv.conf

Nick,

From what type of system are you attempting to bring up a login screen (I assume you are referring to a CDE login screen, but what I am about to say also refers to telnet).

When users connect to the system, one of the first things the system does is attempts to perform a DNS lookup on the IP address of the originating system (using gethostbyaddr()). If you are not using DNS, and the entry isn't in your /etc/hosts file, this will quickly fail and the system will continue and simply use your IP address in lieu of your hostname in any references to the originating system (via either "who -u" or your DISPLAY variable for CDE).

This problem can usually be rectified by ensuring that the DNS server in question serves both A records and PTR records for the hosts it serves -- I have seen a number of NT DNS administrators that will simply leave out the PTR records, since they feel that they are unneccessary.

You can verify this by using the "nslookup" command:

nslookup
nslookup
nslookup
nslookup

If you see an inconsistency between the first/second and the third/fourth, then you should contact your DNS administrator and attempt to rectify this.

Also, if the system cannot resolve its OWN hostname and/or IP address via DNS, you will certainly need to resolve this. The easiest way is to add the following line to your /etc/nsswitch.conf file:

hosts: files [NOTFOUND=continue] dns

This will force lookups to resolve via your /etc/hosts file first and then via the DNS server. (This also has the added benefit that if the DNS server goes down, your system will still know what its own hostname/IP address resolve to)

I hope this helps.
I think, therefore I am... I think!
Nick Wickens
Respected Contributor

Re: Slow "login" after adding DNS server entry into /etc/resolv.conf

Thanks Kenneth - Have battered the NT Administrator and all is now ok.
Hats ? We don't need no stinkin' hats !!