127.0.1.1 in /etc/hosts

Karl Auer kauer at biplane.com.au
Tue Nov 28 00:08:21 UTC 2017


On Mon, 2017-11-27 at 15:47 -0700, Stuart McGraw wrote:
> What is the meaning of the line:
> 
>   127.0.1.1  mymachine.xxx  mymachine

It tells local resolvers that the names "mymachine" and "mymachine.xxx"
have the IP address 127.0.1.1, so if you e.g. "ping mymachine" you will
be pinging 127.0.1.1. There is nothing magical about it.

> package install.)  I am installing some backup software (bacula) 
> which for reasons I haven't delved into, dislikes (as in breaks) 
> when it resolves "mymachine"s address and ends up with 127.0.0.1 
> which is what happens when the above line is present in /etc/hosts.  

bacula getting 127.0.0.1 for "mymachine" has nothing to do with the
above line in your /etc/hosts file. 127.0.0.1 is not the same as
127.0.1.1. If that is not a typo on your part, then something else is
disturbing bacula.

> Will I break something else if I remove or replace the line 
> with the machine's "real" ip address which keeps bacula happy, 
> eg:
> 
>   10.10.200.85  mymachine.xxx  mymachine

The machine's "real IP address *is* 127.0.1.1 :-)

The address 10.10.200.85 is the address of one interface on the
machine.

What is bacula trying to resolve? If it is trying to resolve
"mymachine" or "mymachine.xxx" then it will be getting 127.0.1.1. You
can fix that by configuring bacula to use a different name e.g.
"boris", then appending that name and the appropriate address to
/etc/hosts:

   10.10.200.85 boris

That is IMHO a nicer option that changing the mymachine line.

Regards, K.

-- 
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Karl Auer (kauer at biplane.com.au)
http://www.biplane.com.au/kauer
http://twitter.com/kauer389

GPG fingerprint: A52E F6B9 708B 51C4 85E6 1634 0571 ADF9 3C1C 6A3A
Old fingerprint: E00D 64ED 9C6A 8605 21E0 0ED0 EE64 2BEE CBCB C38B






More information about the ubuntu-users mailing list