Mailinglist Archive: opensuse (888 mails)
| < Previous | Next > |
Re: [opensuse] What is the proper entry for /etc/hosts 127.0.0.1?
- From: "David C. Rankin" <drankinatty@xxxxxxxxxxxxxxxxxx>
- Date: Sun, 02 Jan 2011 18:24:55 -0600
- Message-id: <4D211757.90604@suddenlinkmail.com>
On 12/31/2010 02:55 AM, Per Jessen wrote:
Well,
The documentation shows (man hosts):
IP_address canonical_hostname [aliases...]
showing you can have any number of aliases for a given IP_address
canonical_hostname pair. So I have always included the hostname as an alias
after localhost:
127.0.0.1 localhost phoenix
which provides resolution for localhost as well as your hostname on loopback. I
have run across several web apps that want to be able to resolve the loopback
address with the hostname. The 127.0.0.2 SuSE has used is a hack and there is
talk about doing away with it completely.
The real problem is with dnsdomainname (or hostname -d) which will not resolve
to anything unless you include the full canonical_hostname in /etc/hosts:
127.0.0.1 providence.rlfpllc.com localhost providence
This works fine for dnsdomainname (or hostname -d). Also, since it provides the
definition for localhost on loopback, it does what it is supposed to as far as I
can tell. I can't see any downside to this approach, but I'm skeptical enough to
ask and see if anybody else knows of any gotchas or side-effects from doing
this?
--
David C. Rankin, J.D.,P.E.
Rankin Law Firm, PLLC
510 Ochiltree Street
Nacogdoches, Texas 75961
Telephone: (936) 715-9333
Facsimile: (936) 715-9339
www.rankinlawfirm.com
--
To unsubscribe, e-mail: opensuse+unsubscribe@xxxxxxxxxxxx
For additional commands, e-mail: opensuse+help@xxxxxxxxxxxx
David C. Rankin wrote:
Guys,
What is the proper entry for 127.0.0.1 in /etc/hosts?
My systems all have:
127.0.0.1 localhost
I have seen discussion that 127.0.0.2 is deprecated
Like John says, 127.0.0.0/8 are usually assigned to the loopback
interface, and are usually = localhost.
Well,
The documentation shows (man hosts):
IP_address canonical_hostname [aliases...]
showing you can have any number of aliases for a given IP_address
canonical_hostname pair. So I have always included the hostname as an alias
after localhost:
127.0.0.1 localhost phoenix
which provides resolution for localhost as well as your hostname on loopback. I
have run across several web apps that want to be able to resolve the loopback
address with the hostname. The 127.0.0.2 SuSE has used is a hack and there is
talk about doing away with it completely.
The real problem is with dnsdomainname (or hostname -d) which will not resolve
to anything unless you include the full canonical_hostname in /etc/hosts:
127.0.0.1 providence.rlfpllc.com localhost providence
This works fine for dnsdomainname (or hostname -d). Also, since it provides the
definition for localhost on loopback, it does what it is supposed to as far as I
can tell. I can't see any downside to this approach, but I'm skeptical enough to
ask and see if anybody else knows of any gotchas or side-effects from doing
this?
--
David C. Rankin, J.D.,P.E.
Rankin Law Firm, PLLC
510 Ochiltree Street
Nacogdoches, Texas 75961
Telephone: (936) 715-9333
Facsimile: (936) 715-9339
www.rankinlawfirm.com
--
To unsubscribe, e-mail: opensuse+unsubscribe@xxxxxxxxxxxx
For additional commands, e-mail: opensuse+help@xxxxxxxxxxxx
| < Previous | Next > |