System Administration
cancel
Showing results for 
Search instead for 
Did you mean: 

Name resolution problem from DNS server

trilokpvp
Frequent Advisor

Name resolution problem from DNS server

Hi,

Facing name resolution problem in my hp unix 11.11 server. By this name resolution problem i am not able to connect HP openview Backup manager. Pls suggest to solve the issue. we are having Windows DNS Server and we added the entries in hosts file.

Regards
Trilok
12 REPLIES
Bill Hassell
Honored Contributor

Re: Name resolution problem from DNS server

The /etc/hosts file will have no effect unless you have created the file /etc/nsswitch.conf. Start by copying this file:

cp /etc/nsswitch.files /etc/nsswitch.conf

Change the hosts line and add ipdnodes like this:

hosts: files [NOTFOUND=continue UNAVAIL=continue] dns
ipnodes: files [NOTFOUND=return] dns

Now your /etc/hosts file will be used first, then DNS. Now the above steps would not be needed if your DNS server was properly configured. Many Windows-based DNS servers never add the reverse lookup record which is needed for proper network security.

To verify how each hostname is found, use the nsquery command:

nsquery hosts simeHostname
nsquery hosts 12.34.56.78

The first form searches for the hostname, while the second does a reverse name lookup. Both forms must resolve correctly.


Bill Hassell, sysadmin
trilokpvp
Frequent Advisor

Re: Name resolution problem from DNS server

Hi

Before that hp openview is working fine, form last few days we getting the error message "NO VALID HOSTNAME FOUND" No changes done in server side.

Can u suggest how to solve the issue without using DNS.

There is no nsswitch.conf file in /etc folder

Hostname is asterix, Hp openview cell manager name is asterix.testcorp.com. HP openview is not resolving the name asterix.testcorp.com

when i try nslookup with hostname and ip address it is replaying back.

root:asterix:/etc>nslookup 192.168.70.125
*** Can't find server name for address 192.168.70.90: Non-existent domain
Name Server: alpha.testcorp.com
Address: 192.168.70.50

Trying DNS
Name: asterix.testcorp.com
Address: 192.168.70.125

root:asterix:/etc>nslookup asterix.testcorp.com
*** Can't find server name for address 192.168.70.90: Non-existent domain
Name Server: alpha.testcorp.com
Address: 192.168.70.50

Trying DNS
Name: asterix.testcorp.com
Address: 192.168.70.125
Avinash20
Honored Contributor

Re: Name resolution problem from DNS server

HP openview is not resolving the name asterix.testcorp.com

root:asterix:/etc>nslookup asterix.testcorp.com
*** Can't find server name for address 192.168.70.90: Non-existent domain
Name Server: alpha.testcorp.com
Address: 192.168.70.50

Trying DNS
Name: asterix.testcorp.com
Address: 192.168.70.125 <<==

The resolution is successful via DNS.

You could add the same IP address to hostname in /etc/hosts for faster name resolution

192.168.70.50 asterix.testcorp.com asterix

Also have the nsswitch.conf as stated above, which I believe you would have already done.
"Light travels faster than sound. That's why some people appear bright until you hear them speak."
trilokpvp
Frequent Advisor

Re: Name resolution problem from DNS server

Hi

I had already added the hostname in /etc/hosts

# 192.168.70.125 asterix
# 192.168.70.125 asterix.testcorp.com

192.168.70.125 asterix asterix.testcorp.com
# 192.168.70.125 asterix asterix.test.com

You mention that i have to add the entry as 192.168.70.50 asterix.testcorp.com asterix.
The asterix server ip address is 192.168.70.125, DNS server ip address 192.168.70.50. Which ip address i have to add in hosts file.
Steven E. Protter
Exalted Contributor

Re: Name resolution problem from DNS server

Shalom,

For the backup manager to work via DNS, all hostnames must be correct in the DNS server. If you don't have control of that and follow Bill's steps then you can only impact the configuration of the local system.

The HP openview backup system, if not the same host is going to need this information as well.

You may need to consult the openview documentation to see if this configuration is supported.

SEP
Steven E Protter
Owner of ISN Corporation
http://isnamerica.com
http://hpuxconsulting.com
Sponsor: http://hpux.ws
Twitter: http://twitter.com/hpuxlinux
Founder http://newdatacloud.com
Emil Velez
Honored Contributor

Re: Name resolution problem from DNS server

On a HPUX system

IF DNS is configured the system uses DNS
if dns is not configured as well as NIS then the system uses the /etc/hosts file

if possible you want to have the local hosts file with a full hostname and a short hostname of the local box and all other boxes it directly works with.

15.15.15.9 host1.abc.net host1

Now if you want to you can use the /etc/host file for resolution first and then use DNS if the /etc/hosts file does not have the IP. THis makes your system quite efficient with hostname lookups.

the file that does that is /etc/nsswitch.conf
IN that file put a entry like


hosts: files [ NOTFOUND=CONTINUE ] dns

This entry will say to use /etc/hosts first then failover to dns. the nsswitch file is the only situation where hostname resolution does a failover.

Bill Hassell
Honored Contributor

Re: Name resolution problem from DNS server

Because you do not have /etc/nsswitch.conf, but you do have /etc/resolv.conf, the /etc/hosts file will always be ignored. To stop using DNS, you must rename or remove the file /etc/resolv.conf file. Then, /etc/hosts will work as you expect. You can use nslookup but nsquery is a bit easier to understand.


Bill Hassell, sysadmin
trilokpvp
Frequent Advisor

Re: Name resolution problem from DNS server

Hi

HP openview package is working fine upto last week, from last week we are getting error message "No valid hostname found". Hp openview is running in same server. We checked with HP openview team, they confirmed that HP openview services are up and running only problem with name resolution in server.

When i try to modify the entries in resolv.conf file, unable to save, its a read only file.

Any one pls suggest how to resolve the name resolution. I need Hp openview packup to look for asterix.testcorp.com.

sujit kumar singh
Honored Contributor

Re: Name resolution problem from DNS server

not able to save /etc/resolv.conf -- i assume you should have root access to edit and save.
check the permissions of /etc/resolv.conf
#ll /etc/resolv.conf
#ll /etc/nsswitch.conf
please post also
#cat /etc/resolv.conf
#cat /etc/nsswitch.conf
#cat /etc/hosts
#netstat -nr
#ping
#ping
#traceroute
#traceruote
just do an nslookup and see which DNS server it chooses for Name Resoltion.
regards
sujit
trilokpvp
Frequent Advisor

Re: Name resolution problem from DNS server


Hi,

There is no nsswitch.conf file in /etc folder

when i try nslookup with hostname and ip address it is replaying back.

root:asterix:/etc>nslookup 192.168.70.125
*** Can't find server name for address 192.168.70.90: Non-existent domain
Name Server: alpha.testcorp.com
Address: 192.168.70.50

Trying DNS
Name: asterix.testcorp.com
Address: 192.168.70.125

root:asterix:/etc>nslookup asterix.testcorp.com
*** Can't find server name for address 192.168.70.90: Non-existent domain
Name Server: alpha.testcorp.com
Address: 192.168.70.50

Trying DNS
Name: asterix.testcorp.com
Address: 192.168.70.125

root:asterix:/etc>cat resolv.conf

domain testcorp.com
nameserver 192.168.70.90
nameserver 192.168.70.50

root:asterix:/etc>cat hosts
192.168.70.125 asterix.testcorp.com asterix
# 192.168.70.125 asterix asterix.test.com
# 192.168.70.126 asterix
# 192.168.72.10 asterix
127.0.0.1 localhost loopback

root:asterix:/etc>cat nsswitch.conf
cat: Cannot open nsswitch.conf: No such file or directory
root:asterix:/etc>

Both DNS servers is pining, it is reolving the name from 192.168.70.50 server.

sujit kumar singh
Honored Contributor

Re: Name resolution problem from DNS server

Hi

important observation is that you are able to Ping both the servers that is 192.168.70.50 and 192.168.70.90 , but resolution is taking place using the 192.168.70.50right?

But you can also see during the nslookup that the server 192.168.70.90 Non-Existent.


To Explicitly resolve the name using the 192.168.70.90 do a name lookup as follows and tell the results (It can throw errors : please note them)


#nslookup
#nslookup 192.168.70.125 192.168.70.90


see if that fails.

To confirm the same again, invoke nslookup without any options, this takes you to interactive mode

there at the nslookup propmpt type "server 192.168.70.90" -- this means to choose server 192.168.70.90 for the nam resoultion tests

like
#nslookup
>server 192.168.70.90
>192.168.70.125 --- IP address for name resoultion (it shall use 192.168.70.90 as DNS)

>exit --- to exit or CTRL+C

see if the above tests give errors and what are those.

If that seems that the DNS 192.168.70.90 is not responding to DNS requests.

"please get in touch with the WiN DNS Admin for the server 192.168.70.90."


However on your server you can add the following things:(Log On as the root user)

1)edit the hosts file to add the names of both the DNS as follows and save and exit.

#vi /etc/hosts
192.168.70.125 asterix.testcorp.com asterix
# 192.168.70.125 asterix asterix.test.com
# 192.168.70.126 asterix
# 192.168.72.10 asterix
127.0.0.1 localhost loopback


192.168.70.50 alpha.testcorp.com
192.168.70.90

2)create a new file /etc/nsswitch.conf and add one line to it and save and exit.

#vi /etc/nsswitch.conf
hosts: files dns nis

this will properly configure the DNS services.

regards
sujit

James R. Ferguson
Acclaimed Contributor

Re: Name resolution problem from DNS server

Hi Trilok:

> There is no nsswitch.conf file in /etc folder

There is never a file named '/etc/nsswitch.conf' following a cold-install of HP-UX. There _ARE_ files named:

/etc/nsswitch.compat
/etc/nsswitch.files
/etc/nsswitch.nis
/etc/nsswitch.hp_defaults
/etc/nsswitch.nisplus
/etc/nsswitch.ldap

You are expected to _COPY_ one of these as '/etc/nsswitch.conf' and modify it according to your needs. I think you missed that when Bill originally replied to you.

Also, UNIX does not use the term "folder". The correct word is "directory".

Regards!

...JRF...