127.0.1.1 in /etc/hosts

Tom H tomh0665 at gmail.com
Wed Nov 29 21:11:58 UTC 2017


On Wed, Nov 29, 2017 at 9:45 AM, Liam Proven <lproven at gmail.com> wrote:
> On 27 November 2017 at 23:47, Stuart McGraw <smcg4191 at mtneva.com> wrote:
>>
>> What is the meaning of the line:
>>
>> 127.0.1.1 mymachine.xxx mymachine
>
> Is it not 127.0.0.1?
>
> That is your localhost or home address. All machines that have TCP/IP have that.
>
> https://en.wikipedia.org/wiki/Localhost
>
> It's very well-known:
>
> http://www.thinkgeek.com/product/5d6a/
>
> http://knowyourmeme.com/memes/hack-127-0-0-1
>
> AFAIK you cannot have anything else on 127.x.y.z because the entire
> 127.*.*.* address range resolves to your own machine:
>
> https://serverfault.com/questions/157496/why-is-loopback-ip-address-from-127-0-0-1-to-127-255-255-254

?!

"127.0.0.1" should resolve to "localhost" and "localhost" should
resolve to "127.0.0.1". Debian's been using "127.0.1.1" since 2005 for
the system's hostname.

In 2005, AFAIR, Thomas Hood proposed an nss module that would resolve
the system's hostname to 127.0.1.1 so as not to have an entry for it
in "/etc/hosts" (which is exactly what Lennart's "nss-myhostname" -
called "libnss-myhostname" in Debian and Ubuntu - does, but with
127.0.0.2). There was pushback so he proposed adding a "127.0.1.1
system_hostname" line to "/etc/hosts". This was accepted and it became
the Debian and Ubuntu default.




More information about the ubuntu-users mailing list