1819803 Members
3027 Online
109607 Solutions
New Discussion юеВ

Hostname not resolving

 
Abrar Ayub
Occasional Contributor

Hostname not resolving

I have just setup a 785/B2600 with hpux 11.0. My box is on the network and pingable (using IP address), but I cannot ping the hostname from my other boxes. I cannot even ping the hostname on the same machine...getting error message: unknown host. The DHCP is enabled on my router (linksys) and this is where it is getting its IP address. I have looked at some of the other topics in the resource center and they point to the host and nsswitch.conf file, but I do not even have a /etc/nsswitch.conf file. Another thing that I should point out is that my DHCP table on the router shows the IP address of the unix box, but it does not show the hostname. The router keeps assigning a hostname of "new-host" even though this is not the name that I specify on the machine.

Thank you for any help.
10 REPLIES 10
Ivan Krastev
Honored Contributor

Re: Hostname not resolving

Usualy this is DNS error - dou you have record in your dns server about that box ?
If you don't have dns server perhaps you should specify hostname in router (linksys).
Do the other hosts in network use same router ?

regards,
ivan
Jaime Bolanos Rojas.
Honored Contributor

Re: Hostname not resolving

Abrar,

For sure is a resolution problem?
Are you using a DNS server?
Do you have your host name defined in your /etc/hosts file?
Make sure that other hosts knows your ip-hostname resolution on this new server, the simplest way to do it to to set it up in the hosts file.
Other files that you want to check up are your resolv.conf and your nsswitch.conf file.

Regards,

Jaime.
Work hard when the need comes out.
Abrar Ayub
Occasional Contributor

Re: Hostname not resolving

First of all, thank you for the assistance.

Secondly,

Ivan,

I am not using a dns server. Other machines are using the same router and not having any issues with them. Please note that this is the only unix box on the network. All other are Windows. I reserved an IP on the dhcp (under the unix box's hostname), but that shows up as "inactive" and the unix box still has a different IP address. BTW, the dhcp is running on a Windows 2003 Server.

Jaime,

Are you using a DNS server?
No.

Do you have your host name defined in your /etc/hosts file?
Yes.

Other files that you want to check up are your resolv.conf and your nsswitch.conf file.

resolv.conf looks good with the following entries:
domain (name)
nameserver (IP address)

I have not been able to find the nsswitch.conf file anywhere. There is no file on the box with that name.

Thanks again.
Marvin Strong
Honored Contributor

Re: Hostname not resolving

nsswitch.conf does not exist by default, you have to set it up.

there are a bunch of configurations for you to choose from in /etc.

ll /etc/nsswitch*
pick the appropriate one for your location.
IT_2007
Honored Contributor

Re: Hostname not resolving

You can create a new nsswtich.conf file and add these lines

##/etc/nsswitch.conf file

hosts: files [NOTFOUND=continue] dns
services: files
networks: files
protocols: files
rpc: files
Ivan Krastev
Honored Contributor

Re: Hostname not resolving

Abrar,

take a look at reservation in DHCP pool in 2003 box. Syntax is simmilar to :

IP - MAC addr.

The name part (DNS) is in DNS service , not in DHCP.

Try some things:
1. try to resolve UX box name on DHCP server.
2. if your router (linksys) have own DNS/hosts entries add UX name/IP there.


regards,
ivan

Jaime Bolanos Rojas.
Honored Contributor

Re: Hostname not resolving

Abrar!

If you are on the local host, and you ping it from there with the hostname and you do not get a response, probably it means that the hosts file is not configure properly.


This is an example:

# The form for each entry is:
127.0.0.1 localhost loopback
17.19.48.43 jaime.cro.hp.com CRN360
17.19.48.44 jaime2.cro.hp.com b2000

If you have that, you should be able to log into the HP-UX box and ping by IP and then by hostname.

Regards,

Jaime.
Work hard when the need comes out.
V. Nyga
Honored Contributor

Re: Hostname not resolving

Hi,

you can set this with 'set_parms'.
/sbin/set_parms hostname
/sbin/set_parms ip_address
should work.

HTH
Volkmar
*** Say 'Thanks' with Kudos ***
Abrar Ayub
Occasional Contributor

Re: Hostname not resolving

Creating a nsswtich.conf file fixed the issue. Thanks everyone for your help.
Abrar Ayub
Occasional Contributor

Re: Hostname not resolving

Creation of nsswitch file fixed the hostname issue.