Operating System - HP-UX
1832535 Members
7803 Online
110043 Solutions
New Discussion

Re: Setting DNS on HP-UX 10.2

 
Robert Bencivenga
Occasional Contributor

Setting DNS on HP-UX 10.2

I have tried to set DNS using SAM on HP-UX 10.20 and ran into a problem.
SAM will allow me to enter the IP address of the DNS with no problem and the system will work fine during the session that I eneterd the DNS info for. The problem is that I am prevented from logging in after I log-out. When I try to log-in the log-in window will disappear an x-windows try to start but then fails and sends me back to the log-in prompt. If I log-in using the fail-safe mode and edit out the DNS entries from netconf
I can then log-in. Does anybody have a clue as to why the entering of DNS info kills the log-in window, and how to get around it?
8 REPLIES 8
Brian M. Fisher
Honored Contributor

Re: Setting DNS on HP-UX 10.2

If you are trying to point your HP box to an existing DNS server, create the file /etc/resolv.conf with two entries:
domain companydomain.com
nameserver ###.###.###.###

Brian
<*(((>< er
Perception IS Reality
Robert Bencivenga
Occasional Contributor

Re: Setting DNS on HP-UX 10.2

Thanks for the quick reply.
When editing the resolv file do I put in the information on all the DNS points that I am using?

There is two DNS ip addresses that I am using, a primary and secondary address.

also are you saying to enter the infolike:

Domain Name
ip address <1.2.3.4> ?

TIA
Brian M. Fisher
Honored Contributor

Re: Setting DNS on HP-UX 10.2

My /etc/resolv.conf file looks like:

domain berry.bls.com
nameserver 90.103.192.21

a second and third nameserver line is allowed.

Brian
<*(((>< er
Perception IS Reality
Anthony Goonetilleke
Esteemed Contributor

Re: Setting DNS on HP-UX 10.2

Hi,
If you are simply trying to use an existing server check the following two files.

/etc/nsswitch.conf
it should say something like
hosts: files dns

and /etc/resolv.conf
it should say something like
domain foo.com
nameserver 123.11.1.1
nameserver 123.11.1.2

Where the first entry is the primary and so on.

Simply type nslookup and a hostname that is not in your host file but you know exists on the network and it should tell you the name as long as teh DNS is working and has an entry for it.

i.e

nslookup hosta

Minimum effort maximum output!
Emmanuel Eyer
Frequent Advisor

Re: Setting DNS on HP-UX 10.2

It looks to me that the key issue is following: after setting up DNS, your CDE session cannot be started anymore.

I got this behavior once. The reason was following: DNS did not resolve my IP address to my hostname (I stole an IP address :-(

Thus check following: log in with non-graphical session (or use another system) and run "nslookup xx.xx.xx.xx", where xx.xx.xx.xx is your IP address. Compare it with your hostname (the one in /etc/rc.config.d/netconf, as well as the one in /etc/hosts - they should be the same).

If they are not identical, here is the solution. Either fix your DNS server (best solution !), or change your system name (use SAM or set_parms). Be careful about the latter one, it may be impossible, depending on software already on your system. If you cannot do either, just modify your /etc/nsswitch.conf file for the hosts line to look similar to "hosts: file [NOTFOUND=CONTINUE] dns".

Hope it helps,
Emmanuel
Robert Bencivenga
Occasional Contributor

Re: Setting DNS on HP-UX 10.2

Thanks for all the help so far.
Heres what I've found so far.

nslookup
no response from the server

nslookup
returned my host name and adress, the diferance being that the hostname was longer

I changed my host name to match what the server was showing and rebooted
upon trying to log-in now the cde will hang with an error message(sorry didn't write it down). I need to perform a cntrl/shift/break to get out of it.

I tried nslookup -swdebug
recieved the message PARSE SUCCESSFULL

I tried nslookup
>policy
recieved
#lookups=3
dns [RRCR] nis [RRCR] files [RRRR]

I checked my /etc/resolv.conf file. I did have it saying
search
nameserver # pri
nameserver # sec

I changed the statement search to
domain

tried to login again after a reboot and recieved the same error message/hang.

I checked the /etc/nsswitch.conf and this is what was set in there:
hosts: dns [ NOT FOUND=return UNAVAIL=continue TRY AGAIN=return]
nis [ NOT FOUND=return UNAVAIL=continue TRY AGAIN=return]
files [ NOT FOUND=return UNAVAIL=continue TRY AGAIN=return]

protocols: NIS [ NOT FOUND=return UNAVAIL=continue] files
services: NIS [ NOT FOUND=return UNAVAIL=continue] files
networks: NIS [ NOT FOUND=return UNAVAIL=continue] files
netgroup: NIS [ NOT FOUND=return UNAVAIL=continue] files
rpc: NIS [ NOT FOUND=return UNAVAIL=continue] files


I checked my /etc/rc.config.d/netconf file noticed that the ROUTE_GATEWAY
statement said:
ROUTE_GATEWAY [0] = "gateway_address in name format"
changed to read the name as an decimal address instead.
Tried to reboot and login again and recieved the same error message/hang again.

I did put a call in to the server administrator to change the hostname for me to reflect only 8 characters only vice "9 characters.7 characters.4 characters.4 characters.3 characters" this was because set_parms stated uname only allows 8 to be read.

so here I sit now. If anybody has anything else I can try I would appreciate it.

TIA
Albert E. Whale, CISSP
Honored Contributor

Re: Setting DNS on HP-UX 10.2

Robert,

The simplest way out of this is to put your workstation in the /etc/hosts file, until DNS is fixed.

After you enter the info for your workstation, then you need to edit /etc/nsswitch.conf and verify that the hosts line starts with file dns nis (if you use nis - I personally would not).

When the Name Server can correctly resolve your IP Address to Name relationship, then your problem will be resolved and you can change the hosts: line back to dns file.

Hope that helps.
Sr. Systems Consultant @ ABS Computer Technology, Inc. http://www.abs-comptech.com/aewhale.html & http://www.ancegroup.com
Anthony Goonetilleke
Esteemed Contributor

Re: Setting DNS on HP-UX 10.2

I have also seen problems where people have created machine names with more than 8 characters. This can be a problem for DNS. Change your nsswitch.conf to have hosts first and place all the hosts you access including DNS in this.
Minimum effort maximum output!