Operating System - HP-UX
1753518 Members
5195 Online
108795 Solutions
New Discussion юеВ

Host name not getting resolved

 
SOLVED
Go to solution
jayachandran.g
Regular Advisor

Host name not getting resolved

Hi all

I have two servers in cluster. SRV1 and SRV2.One of the processes in SRV2 server is trying to get the hostname for the SRV1 servers ipaddress.

The Error: Unable to get the hostname for the ipaddress 10.1.1.1 (10.1.1.1 is the SRV1 ipaddress)

I have checked the /etc/hosts file, found that the ipaddress and the host name for this ipaddress is missing in both the servers.

Then I have added the ipaddress and host name in both of the servers.

But then too problem is not solved.

help me, thanks in advance

15 REPLIES 15
RAC_1
Honored Contributor
Solution

Re: Host name not getting resolved

Do both servers use /etc/hosts for host name resolution? Check /etc/nsswitch.conf file.
There is no substitute to HARDWORK
Victor BERRIDGE
Honored Contributor

Re: Host name not getting resolved

Hi,
Have you checked your /etc/nsswitch.conf file and /etc/resolv.conf, their perms and for nsswitch.conf if you do have something like:
hosts: files [NOTFOUND=continue] dns

Are these addresses correctly routed?
(correct subnet route, netmask..)

What are the perms on your hosts file? (444)

All the best
Victor
jayachandran.g
Regular Advisor

Re: Host name not getting resolved

Hi RAC/Victor

There is no nsswitch.conf (or) resolv.conf file in the servers.

I have already checked and rectified the host file.

entry for the ipaddress 10.1.1.1 was missing previously.And I have already added the missing Ipaddress to the host files.
Darrel Louis
Honored Contributor

Re: Host name not getting resolved

Hi,

Have you added the servers to the /etc/hosts file asfollow:

10.1.1.1 srv1.domain.com srv1

And as already mentioned check your /etc/nsswitch.conf file.
If the file doesn't exists copy it.
# cp /etc/nsswitch.files /etc/nsswitch.conf
Modify the line hosts:
hosts: files [ NOTFOUND=continue ] dns

Goodluck

Darrel Louis
MarkSyder
Honored Contributor

Re: Host name not getting resolved

You will probably have a file /etc/nsswitch.compat, which can be copied to nsswitch.conf.

You should set it up so it uses files first for hosts.

Mark Syder (like the drink but spelt different)
The triumph of evil requires only that good men do nothing
Victor BERRIDGE
Honored Contributor

Re: Host name not getting resolved

Hi again!
What servers and most important what cluster are you talking about?
It may be nothing to do with the servers themselves but more the way a process is looking for his "hostname"...
A cluster like mcSG will have on a host ist address (HW-server) + the addresses of the packages running on it....

All the best
Victor
Frank de Vries
Respected Contributor

Re: Host name not getting resolved

Otherwise you can create the nsswitch.conf
in the /etc directory and put this
contents in it

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

If will first check your local /etc/hosts
and then check your dns

You can troubleshoot with nslookup command:

I have a host called frank only in /etc/hosts
10.214.9.118 frank

When I use nslookup it will show where it
resolved it.

[orapic@orasrv1:]/etc<>>> nslookup
Using /etc/hosts on: orasrv1

> frank
Using /etc/hosts on: orasrv1

looking up FILES
Name: frank
Address: 10.214.9.118

>

Good luck
Look before you leap
jayachandran.g
Regular Advisor

Re: Host name not getting resolved

Hi All

Host name to IP address maping is working fine.

Ip to Hostname is not working.

Regards
Jayachandran.G
spex
Honored Contributor

Re: Host name not getting resolved

Hi,

Try using nslookup to do reverse DNS:

# nslookup
# nslookup

If the IP address is resolved correctly, try restarting the processes. This will force them to re-read configuration.

Did you create /etc/nsswitch.conf and /etc/resolv.conf ?

PCS