1824170 Members
2336 Online
109669 Solutions
New Discussion юеВ

hostname lookup issue

 
lbdwag
Frequent Advisor

hostname lookup issue

Hi:

I am attempting to install an 11.31 UX server (Integrity rx3600) and I cannot get the system to resolve its' hostname to the correct IP.

The system is behind a firewall, so it has a private IP (the one that the system has, ex: 10.1.1.10) and a public IP 20.1.1.10, which is in DNS. When I use the host command it comes up with the public IP. I cannot put the private IP in DNS.

The /etc/host file has the private IP listed, and the /etc/nsswitch.conf file has files listed 1st.

hosts returns the public IP.
nslookup private-IP-Address returns:
#############################################
Using /etc/hosts on: hostname.domain.com

looking up FILES
Trying DNS
***dnsserver.domain.com can't find private-IP-Address: Non-existent domain
#############################################

This makes me think that it is not even using the files....

How do we get the system to resolve its' name as the private IP?
-- Don
15 REPLIES 15
Michael Steele_2
Honored Contributor

Re: hostname lookup issue

Hi Don:

This is what the alias is for in both /etc/hosts and the DNS. Something like:

host1 123.123.123.123 host2
host2 234.234.234.234 host1
Support Fatherhood - Stop Family Law
Rita C Workman
Honored Contributor

Re: hostname lookup issue

Have you talked to your networking person. Can't they put in a line to "flip" the private IP to the public IP for you in the firewall.

/rcw
Tim Nelson
Honored Contributor

Re: hostname lookup issue

Your /etc/nsswitch.conf should have an entry like this.

hosts: files [NOTFOUND=continue] dns


lbdwag
Frequent Advisor

Re: hostname lookup issue

/etc/hosts:

# @(#)B.11.31_LRhosts $Revision: 1.9.214.1 $ $Date: 96/10/08 13:20:01 $
#
# The form for each entry is:
#
#
# For example:
# 192.1.2.34 hpfcrm loghost
#
# See the hosts(4) manual page for more information.
# Note: The entries cannot be preceded by a space.
# The format described in this file is the correct format.
# The original Berkeley manual page contains an error in
# the format description.
#

20.1.1.12 dns.domain.com dns
10.1.1.12 ux.domain.com ux2
127.0.0.1 localhost loopback




/etc/nsswitch.conf:
#
# /etc/nsswitch.hp_defaults:
#
# @(#)B.11.31_LR
#
# An example file that could be copied over to /etc/nsswitch.conf; it
# uses NIS (YP) in conjunction with files.
#

passwd: compat
group: compat
hosts: files dns [NOTFOUND=return] nis [NOTFOUND=return]
ipnodes: dns [NOTFOUND=return] nis [NOTFOUND=return] files
networks: nis [NOTFOUND=return] files
protocols: nis [NOTFOUND=return] files
rpc: nis [NOTFOUND=return] files
publickey: nis [NOTFOUND=return] files
netgroup: nis [NOTFOUND=return] files
automount: files nis
aliases: files nis
services: nis [NOTFOUND=return] files
-- Don
Tim Nelson
Honored Contributor

Re: hostname lookup issue

Two items just for fun.

Try nsquery hosts 10.1.1.10

and

If you are NOT using NIS then get rid of the references in /etc/nsswitch.conf
cp /etc/nsswitch.file /etc/nsswitch.conf

test again.

Then append the files line with dns.

Michael Steele_2
Honored Contributor

Re: hostname lookup issue

I don't think your /etc/hosts file is correct unless you've cut out the server's hostname. Which should be the second entry after the reserve name loopback.

# @(#)B11.23_LRhosts $Revision: 1.9.214.1 $ $Date: 96/10/08 13:20:01 $
#
# The form for each entry is:
#
#
# For example:
# 192.1.2.34 hpfcrm loghost
#
# See the hosts(4) manual page for more information.
# Note: The entries cannot be preceded by a space.
# The format described in this file is the correct format.
# The original Berkeley manual page contains an error in
# the format description.
#
XXX.XXX.XXX.XXX localhost loopback
XXX.XXX.XXX.XXX machine1 MACHINE1 MACHINE1.
XXX.XXX.XXX.XXX MACHINE2 machine2


Compare your /etc/hosts file with the default under /usr/newconfig/etc/hosts to be sure.
Support Fatherhood - Stop Family Law
lbdwag
Frequent Advisor

Re: hostname lookup issue

Tim:

$ nsquery hosts 10.1.1.12

Using "files dns [NOTFOUND=return] nis [NOTFOUND=return] " for the hosts policy.


Searching /etc/hosts for 10.1.1.12
Hostname: ux.domain.com
Aliases: ux
Address: 10.1.1.12
Switch configuration: Terminates Search


I also ran:

$ nsquery hosts ux2

Using "files dns [NOTFOUND=return] nis [NOTFOUND=return] " for the hosts policy.

Searching /etc/hosts for ux2
Hostname: ux.domain.com
Aliases: ux
Address: 10.1.1.12
Switch configuration: Terminates Search


This appears that it is resolving the IP and host name correctly.


When I run ping ux2 it returns:
PING ux2.colgate.edu: 64 byte packets

ctrl-c

----ux2.colgate.edu PING Statistics----
# packets transmitted, 0 packets received, 100% packet loss


Maybe I am barking up the wrong tree, but does ping use the same resolver as nsquery?
-- Don
Torsten.
Acclaimed Contributor

Re: hostname lookup issue

Are you trying to ping through the firewall?

Hope this helps!
Regards
Torsten.

__________________________________________________
There are only 10 types of people in the world -
those who understand binary, and those who don't.

__________________________________________________
No support by private messages. Please ask the forum!

If you feel this was helpful please click the KUDOS! thumb below!   
lbdwag
Frequent Advisor

Re: hostname lookup issue

Michael:

The only difference that I see between my /etc/hosts file and the example that you posted is that my list is upside down.

1st entry is DNS server
2nd entry is hostname
3rd entry is loopback

I would not think that the order would be that picky; we used the configuration program (I cannot remember the name right now) to do all of the network setup....
-- Don
lbdwag
Frequent Advisor

Re: hostname lookup issue

Torsten:

I am not trying to ping through the firewall, but it appears (to me that is) that it is trying to ping the public IP; which would be going out the firewall then back in.
-- Don
Jeeshan
Honored Contributor

Re: hostname lookup issue

if you want to resolve your host add entries in /etc/resolv.conf

domain
nameserver
nameserver
a warrior never quits
lbdwag
Frequent Advisor

Re: hostname lookup issue

ahsan:

/etc/resolv.conf:

domain <>
nameserver 20.1.1.100


I thought this was only for the DNS server(s) entries? How would I add in my host?

domain ux
namerserver 10.1.1.12

?????????????


-- Don
lbdwag
Frequent Advisor

Re: hostname lookup issue

to all,

This is my 1st exposure to HP-UX, so if I seem a little green hopefully it will make a bit of sense...
-- Don
lbdwag
Frequent Advisor

Re: hostname lookup issue

Tech support said that the resolving in "host ux" is a 'bug'.

However for ping ux to get the correct IP, it was the ipnodes line in /etc/nsswitch.conf. It was set to use DNS -> NIS -> files.
-- Don
Tim Nelson
Honored Contributor

Re: hostname lookup issue

One of the quirks with 11.31 is that if nslookup cannot resolve your name server defined in /etc/resolv.conf both reverse and forward then nslookup and perhaps others will not function properly.

e.g. DNS server must have entries for both forward and reverse IPs and match.

Does this effect other network utilities ? Maybe.

Either way. Fix your nsswitch.conf and remove all the NIS entries. Make sure you can lookup up both the forward and reverse addresses of any named servers configured in resolv.conf and get nslookup working properly.

At least then we have a good starting point.