Joe Schmoe
Posts: 4277
Joined: Sun Jan 15, 2012 1:11 pm

127.0.1.1 line in /etc/hosts

Thu Jul 09, 2015 11:51 am

I note that /etc/hosts has this line:

127.0.1.1 myhostname

My question is: Why is this here? What will break if it is removed?
I am not looking for help in the sense of "omigod myssytemwontboot", but rather am hoping that someone involved in the setup of Raspbian actually knows why it is there and would be willing to share that information.

A couple of notes:
  1. I realize that the main reason it is there is because of "cargo cult" thinking, but, again, I'm hoping someone actually knows...
  2. I realize that 127.0.1.1 is basically an alias for the usual 127.0.0.1, so I'm curious why this other address was used. I note in passing that most other Unix and Unix-like systems just put the current system name on the same line as the regular "localhost" line - like this:
    127.0.0.1 localhost myhostname
  3. Yes, I have a reason to want to remove this; I will reveal that reason in a later post (if needed).
And some folks need to stop being fanboys and see the forest behind the trees.

(One of the best lines I've seen on this board lately)

User avatar
DougieLawson
Posts: 33020
Joined: Sun Jun 16, 2013 11:19 pm
Location: Basingstoke, UK
Contact: Website

Re: 127.0.1.1 line in /etc/hosts

Thu Jul 09, 2015 2:02 pm

It'll break. It's used by GNOME.

Funny how Dr. Google helped me to find that.
Microprocessor, Raspberry Pi & Arduino Hacker
Mainframe database troubleshooter
MQTT Evangelist
Twitter: @DougieLawson

2012-18: 1B*5, 2B*2, B+, A+, Z, ZW, 3Bs*3, 3B+

Any DMs sent on Twitter will be answered next month.

User avatar
cyrano
Posts: 713
Joined: Wed Dec 05, 2012 11:48 pm
Location: Belgium

Re: 127.0.1.1 line in /etc/hosts

Thu Jul 09, 2015 2:04 pm

Sounds like a simple typo to me...

User avatar
DougieLawson
Posts: 33020
Joined: Sun Jun 16, 2013 11:19 pm
Location: Basingstoke, UK
Contact: Website

Re: 127.0.1.1 line in /etc/hosts

Thu Jul 09, 2015 2:20 pm

cyrano wrote:Sounds like a simple typo to me...
Any address in 127.xxx.xxx.xxx/8 is a loopback address. GNOME uses 127.0.1.1 as a special case, it's in DebIan, Ubuntu and Raspbian - it's no a typo.
Microprocessor, Raspberry Pi & Arduino Hacker
Mainframe database troubleshooter
MQTT Evangelist
Twitter: @DougieLawson

2012-18: 1B*5, 2B*2, B+, A+, Z, ZW, 3Bs*3, 3B+

Any DMs sent on Twitter will be answered next month.

Joe Schmoe
Posts: 4277
Joined: Sun Jan 15, 2012 1:11 pm

Re: 127.0.1.1 line in /etc/hosts

Thu Jul 09, 2015 2:34 pm

Do we use "GNOME"?
And some folks need to stop being fanboys and see the forest behind the trees.

(One of the best lines I've seen on this board lately)

Joe Schmoe
Posts: 4277
Joined: Sun Jan 15, 2012 1:11 pm

Re: 127.0.1.1 line in /etc/hosts

Thu Jul 09, 2015 2:35 pm

it's no a typo.
Priceless!
And some folks need to stop being fanboys and see the forest behind the trees.

(One of the best lines I've seen on this board lately)

User avatar
PeterO
Posts: 4182
Joined: Sun Jul 22, 2012 4:14 pm

Re: 127.0.1.1 line in /etc/hosts

Thu Jul 09, 2015 2:43 pm

DougieLawson wrote:It'll break. It's used by GNOME.

Funny how Dr. Google helped me to find that.
Reference please .

PeterO
Discoverer of the PI2 XENON DEATH FLASH!
Interests: C,Python,PIC,Electronics,Ham Radio (G0DZB),Aeromodelling,1960s British Computers.
"The primary requirement (as we've always seen in your examples) is that the code is readable. " Dougie Lawson

User avatar
RaTTuS
Posts: 9924
Joined: Tue Nov 29, 2011 11:12 am
Location: North West UK

Re: 127.0.1.1 line in /etc/hosts

Thu Jul 09, 2015 2:55 pm

PeterO wrote:
DougieLawson wrote:It'll break. It's used by GNOME.

Funny how Dr. Google helped me to find that.
Reference please .

PeterO
https://www.debian.org/doc/manuals/debi ... resolution
How To ask Questions :- http://www.catb.org/esr/faqs/smart-questions.html
WARNING - some parts of this post may be erroneous YMMV

1QC43qbL5FySu2Pi51vGqKqxy3UiJgukSX
Covfefe

User avatar
joan
Posts: 13410
Joined: Thu Jul 05, 2012 5:09 pm
Location: UK

Re: 127.0.1.1 line in /etc/hosts

Thu Jul 09, 2015 3:08 pm

Joe Schmoe wrote:
it's no a typo.
Priceless!
No is not a typo, it's Scottish dialect.

User avatar
DougieLawson
Posts: 33020
Joined: Sun Jun 16, 2013 11:19 pm
Location: Basingstoke, UK
Contact: Website

Re: 127.0.1.1 line in /etc/hosts

Thu Jul 09, 2015 4:27 pm

http://www.leonardoborda.com/blog/127-0 ... tu-debian/ was the first hit when I searched Google. Since DebIan is close enough to Ubuntu it's relevant.

How hard is it to run this search: https://www.google.co.uk/search?q=127.0.1.1+debian
Microprocessor, Raspberry Pi & Arduino Hacker
Mainframe database troubleshooter
MQTT Evangelist
Twitter: @DougieLawson

2012-18: 1B*5, 2B*2, B+, A+, Z, ZW, 3Bs*3, 3B+

Any DMs sent on Twitter will be answered next month.

slmingol
Posts: 1
Joined: Fri Jul 13, 2018 1:38 pm

Re: 127.0.1.1 line in /etc/hosts

Fri Jul 13, 2018 1:41 pm

This issue is well covered here in this Serverfault Q&A - https://serverfault.com/questions/36309 ... 7-0-0-1-in.

DirkS
Posts: 8074
Joined: Tue Jun 19, 2012 9:46 pm
Location: Essex, UK

Re: 127.0.1.1 line in /etc/hosts

Fri Jul 13, 2018 2:23 pm

slmingol wrote:
Fri Jul 13, 2018 1:41 pm
This issue is well covered here in this Serverfault Q&A - https://serverfault.com/questions/36309 ... 7-0-0-1-in.
Yes, and it was also well covered in this topic before you necroed it.
Including someone pointing to the same document as in the answer on serverfault.

Roken
Posts: 181
Joined: Sun Dec 31, 2017 4:35 pm

Re: 127.0.1.1 line in /etc/hosts

Fri Jul 13, 2018 8:16 pm

DougieLawson wrote:
Thu Jul 09, 2015 4:27 pm
Since DebIan is close enough to Ubuntu it's relevant
I disagree, Ubuntu is close enough to Debian. Chickens and eggs.
Headless PI. OMG, someone cut it's head off. Oh, hang on. it didn't have one to start with.

User avatar
DougieLawson
Posts: 33020
Joined: Sun Jun 16, 2013 11:19 pm
Location: Basingstoke, UK
Contact: Website

Re: 127.0.1.1 line in /etc/hosts

Fri Jul 13, 2018 9:11 pm

Roken wrote:
Fri Jul 13, 2018 8:16 pm
DougieLawson wrote:
Thu Jul 09, 2015 4:27 pm
Since DebIan is close enough to Ubuntu it's relevant
I disagree, Ubuntu is close enough to Debian. Chickens and eggs.
Pedantic necrology isn't worth the effort. You're arguing about something from three years ago.
Microprocessor, Raspberry Pi & Arduino Hacker
Mainframe database troubleshooter
MQTT Evangelist
Twitter: @DougieLawson

2012-18: 1B*5, 2B*2, B+, A+, Z, ZW, 3Bs*3, 3B+

Any DMs sent on Twitter will be answered next month.

Return to “Raspbian”

Who is online

Users browsing this forum: No registered users and 9 guests