Operating System - HP-UX
1748111 Members
3845 Online
108758 Solutions
New Discussion юеВ

If i have two NICs and two ip address, do i need to have the entries for those two IPs on /etc/host

 
SOLVED
Go to solution
senthil_kumar_1
Super Advisor

If i have two NICs and two ip address, do i need to have the entries for those two IPs on /etc/host

Hi All,

If i have two NICs and two ip address, do i need to have the entries for those two IPs on /etc/hosts.

or how to configure the /etc/hosts file if i have two NICs.
6 REPLIES 6
Rita C Workman
Honored Contributor

Re: If i have two NICs and two ip address, do i need to have the entries for those two IPs on /etc/host

Well,...... if you want one or both of those network connections to actually make use (coming & going) of the network you might want to edit the /etc/hosts and add them.

Now you don't have to put them /etc/hosts if you are absolutely only using DNS to resolve IP's. In that case just give the info to the network person to add them to DNS.
But I don't know why anyone would just use DNS resolution and not have it the /etc/hosts file. Most folks have nsswitching go to hostfile first then DNS. To each his own.

But I'm guessing since they were installed you really do want to use them.....

Regards,
Rita
Steven E. Protter
Exalted Contributor

Re: If i have two NICs and two ip address, do i need to have the entries for those two IPs on /etc/host

Shalom,

/etc/hosts entries are not required at all.

However when missing external systems sometimese have slow connectivity, so I would do so.

Take a look at /etc/nsswitch.conf to see if files are used before DNS for host resolution.

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
Steven Schweda
Honored Contributor

Re: If i have two NICs and two ip address, do i need to have the entries for those two IPs on /etc/host

> [...] do i need to have the entries for
> those two IPs on /etc/hosts.

Do you ever wish to refer to those interfaces
by name, or only by address?

> [...] how to configure the /etc/hosts file
> if i have two NICs.

man hosts

http://docs.hp.com/
http://docs.hp.com/en/B2355-60130/hosts.4.html
James R. Ferguson
Acclaimed Contributor
Solution

Re: If i have two NICs and two ip address, do i need to have the entries for those two IPs on /etc/host

Hi:

I concur with Rita. I'd specify the addresses of the server in its own '/etc/hosts' appropriately. I too configure '/etc/nsswitch.conf' to point to "files" then "DNS" to insure that a server can always resolve its own IP address to its name.

Regards!

...JRF...
Fred K. Abell Jr._1
Regular Advisor

Re: If i have two NICs and two ip address, do i need to have the entries for those two IPs on /etc/host

I have 2 NIC and give each one an entry in /etc/hosts.

I use 1 NIC for standard internet connections, the other NIC is for a private 192 address. When making an NFS mount on the 192 network, having a separate host name removes confusion.

Fred
Hakki Aydin Ucar
Honored Contributor

Re: If i have two NICs and two ip address, do i need to have the entries for those two IPs on /etc/host

>Senthil: If i have two NICs and two ip address, do i need to have the entries for those two IPs on /etc/host

The only conflict with hostname , as if you will have two hostname if you put them on /etc/hosts .
So, which one is higher priority for example when you run nslookup ? You might have a problem and you might have to some additional modifications ,probably in /etc/rc.config.d/netconf OR/AND /etc/nsswitch.conf