Operating System - HP-UX
1753957 Members
7542 Online
108811 Solutions
New Discussion юеВ

Re: netstat response time pb

 
JACQUET
Frequent Advisor

netstat response time pb

Hi,

I'm encountering Pb of response time with netstat command (used by MC/Services Guard for the SAP Package Extension given by HP). netstat -i is very long to execute.
I have one of the latest netstat patch (PHNE_17434), and HP advised me to put an entry in /etc/hosts file with "0.0.0.0 all-zeros-broadcast", but it doesn't change anything. I'm using Novell DNS. Looking for the requests send to the DNS by netstat, i noticed that some of those requests are "127.0.0.0" ???? a king of broadcast to the loopback interface !!!!! So, i put another entry in /etc/hosts file "127.0.0.0 loopback-broadcast" and it is Ok for now, but not "clean", let's say. Have someone encountered already that problem, and have a clean solution, avoiding to polute /etc/hosts file ?
Thanks for the help.
PJA
5 REPLIES 5
CHRIS ANORUO
Honored Contributor

Re: netstat response time pb

Hi Jac,

You are not polluting /etc/hosts file with those entries. It is strongly recommended that you have in your /etc/hosts file this following entry lines:
127.0.0.1 localhost loopback
0.0.0.0 anyhost

Thses are used by the system for broadcast and other network messaging (like sendmail, mailx, uucp, etc)
When We Seek To Discover The Best In Others, We Somehow Bring Out The Best In Ourselves.
Lasse Knudsen
Esteemed Contributor

Re: netstat response time pb

I would imagine that 127.0.0.0 is a network address and it tries to look up the name of the network.

My (default) /etc/network contains a line:

loopback 127

Does yours do that too ??
In a world without fences - who needs Gates ?
melvyn burnard
Honored Contributor

Re: netstat response time pb

One thing I would strongly recommend is that you ensure your /etc/hosts file has all the correct entries for every server AND package IP address in the MC/SG cluster configuration, as well as the loopback entry.
Then configure /etc/nsswitch.conf file to go first to hosts, then DNS.
This alleviates problems caused by DNS servers being wrong, slow, down etc.
My house is the bank's, my money the wife's, But my opinions belong to me, not HP!
Kofi ARTHIABAH
Honored Contributor

Re: netstat response time pb

Hi Jacques:

The reason that netstat -i is taking a long time to comeback is because it is trying to do a name lookup (DNS) of every address that appears in the output-typically if you are not concerned about the names and only want the IP addresses, use:
netstat -in
(this is quicker because it does not try and do a name lookup of the IP address to resolve them)

You will have these same issues with many applications that try and resolve IP addresses to names - it is a good idea to "populate" your hosts table with IP addresses that do not appear in your DNS but for which your server needs to contact.. after populating the /etc/hosts file, you would then set up your /etc/nsswitch.conf to :

hosts: files [NOTFOUND=continue] dns

this tells the system to first look in the /etc/hosts file and if that fails, fall back to dns.

PS. The other thing you could do is that in your DNS records, you could create entries for 0.0.0.0 and 127.0.0.0 (that way, any server that looks up these addresses will get a response !)
nothing wrong with me that a few lines of code cannot fix!
JACQUET
Frequent Advisor

Re: netstat response time pb

Hi,

Thanks for your help. I checked several points you submitted.
My /etc/nsswitch.conf is set up to resolve Name in /etc/hosts before asking to DNS.
My /etc/networks contains the line "loopback 127" (Standard OS Installation)
Indeed, i already put relocatable IP adresses of cluster package in /etc/hosts file.
Then, an other way could be to add entry in DNS Server...
But i'm still wondering why netstat is searching for 127.0.0.0 adress !!!
PJA