Operating System - Linux
1752777 Members
6367 Online
108789 Solutions
New Discussion юеВ

Re: loopback IP entry in /ec/hosts

 
Alzhy
Honored Contributor

loopback IP entry in /ec/hosts

Should'nt loopback IP really should only point to localhost.localdomain and localhost?

For some reason or another, a client has the following entry in their Linux hosts. And it sems to be questioned by NetBackup support as the culprit in some backups failing.

# Do not remove the following line, or various programs
# that require network functionality will fail.
127.0.0.1 sapsrv1.xyz.com sapsrv localhost.localdomain local
host
::1 localhost6.localdomain6 localhost6
10.201.100.100 sapsrv1.xyz.com sapsrv1


resolver for host is : files dns


TIA.
Hakuna Matata.
5 REPLIES 5
Jeff_Traigle
Honored Contributor

Re: loopback IP entry in /ec/hosts

That's the only way I've ever seen it defined. Having the actual hostname of the server defined to be the loopback address could certainly cause some confusion in lookups. We had similar issues with Heartbeat/DRBD when SLES tried to be too smart by assigning the hostname to both the public and private IP addresses when configuring through YaST.
--
Jeff Traigle
Huc_1
Honored Contributor

Re: loopback IP entry in /ec/hosts

Correct me if i am wrong but shouldn't The line line

127.0.0.1 sapsrv1.xyz.com sapsrv localhost.localdomain local
host

BE

127.0.0.1 sapsrv1.xyz.com sapsrv1 localhost.localdomain local
host

Notice sapsrv1 not sapsrv

Enjoy life

Jean-Pierre Huc
Smile I will feel the difference
Matti_Kurkela
Honored Contributor

Re: loopback IP entry in /ec/hosts

The reason to associate the system's hostname (in both FQDN and short forms) to 127.0.0.1 is DHCP and/or mobile use.

If the hostname is not associated to an usable IP address when the system is starting up, some daemons and other applications may fail to start properly.

In a system that uses DHCP or is mobile (so it might not have no network connection at all sometimes!), the only guaranteed always-available IP addresses are the 127.*.*.* addresses.

Some Linux distributions (e.g. Debian 6.0) leave the 127.0.0.1 strictly for "localhost", and associate the hostname to 127.0.1.1: since all the 127.*.*.* addresses work as loopback addresses, this works.

If your system has statically configured IP addresses, you're free to remove the hostname from the 127.0.0.1 line and to associate it with the system's permanent IP address only.

But if your IP addresses are assigned with DHCP, you should at least test what happens if the system is booted when the DHCP server does not respond and the previous lease information (often stored persistently in e.g. /var/lib/dhcp) is expired or deleted.

MK
MK
Alzhy
Honored Contributor

Re: loopback IP entry in /ec/hosts

These are servers. Naturally they're static but I hear ya MK -- there are sites that do use DHCP.

Doen't localhost.localdomain in the loopback IP "satisfy" most network services' need for a FQDN including sendmail if server is off network?

Symantec contends and I do agree (all our UNIX servers in my other clents do not have any other entry in the loopback address aside from localhost.



Hakuna Matata.
Michael Leu
Honored Contributor

Re: loopback IP entry in /ec/hosts

Hi Alzhy, your thread reminded me about this being covered in a few SAP notes (with a system called sapsrv1 it might apply ;-)

For example inside
Note 1496410 - Red Hat Enterprise Linux 6: Installation and Upgrade
https://service.sap.com/sap/support/notes/1496410
see the section 'Hostname'...