Linux - NewbieThis Linux forum is for members that are new to Linux.
Just starting out and have a question?
If it is not in the man pages or the how-to's this is the place!
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
Don't you mean 127.0.0.1? It's the localhost loop back address for the same machine you are using. Some programs are written generically to communicate with components or a client via the network. If you are running the client part and the server part on the same machine, using the localhost address, the bottom of the network stack can be bypasses. Sometimes a network socket is used for interprocess communication.
Actually I think according to the standard, that 127.0.0.0 is a class one network for localhost. I'm not certain on this. I have seen "127.0.0.2 localhost" in /etc/hosts.
There will not be 127.0.1.1 in /etc/hosts. If it exists just change it into 127.0.0.1.
127.0.0.1 localhost.localdomain localhost
special IP number (127.0.0.1) that is designated for the software loopback interface of a machine. 127.0.0.0 through 127.255.255.255 is also reserved for loopback and is used for internal testing on local machines.
It must be there irrespective you have a Ethernet card or not...
Nothing wrong with the 1.1 as any 127* address references the local machine. Having multiple such IP addresses can be convenient when you want/need your localhost to be addressed in more ways than one. For example, one could resolve to "localhost", another to a fully qualified name, etc.
From the computer I am using right now:
127.0.0.1 localhost Selena
127.0.1.1 Selena.Arcturus.net Selena
@jschiwal
the 0.2 address is used by some spam filters.
By default after a new install. All 3 refer to the local machine.
It wouldn't be incorrect to change the secondary one to the true ip address of the local machine (if static) or remove it entirely. However, do not change it to 127.0.0.1 unless you know that is what you want. Generally speaking, you don't want to mess with it unless you have a specific reason.
Different distributions handle the 127.x.x.x addresses differently except for 127.0.0.1 typically. Just remember any 127/8 address refers to the local machine.
I was aware that 127.0.1.1 would refer to the local machine, but I don't think I have seen that pattern being used as the IP address for the FQDM of the local machine. Is this the convention of a certain distro, or is it based on an RFC?
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.