2 ms·
"The "localhost" hostname points at 127.0.0.1, but it will also have a loopback interface (which is a dummy software-only interface that just connects back to y
by 1vuio0pswjnm7 5y ago
"The "localhost" hostname points at 127.0.0.1, but it will also have a loopback interface (which is a dummy software-only interface that just connects back to your computer)."
AFAIK, 127.0.0.1 localhost as a HOSTS file entry is merely a convention. For example, the name "localhost" can point to any address in the 127.x.x.x address space or any address in general. Similarly, a loopback interface can be assigned any 127.x.x.x address. The convention is to assign 127.0.0.1.
One of the nice things about NetBSD (IMO) is that when compiling one's own system, a loopback is not necessarily automatically created. It may be left up to the user to create one and assign it with an address. This can teach the user what software depends on the presence of a loopback interface that is assigned "127.0.0.1".
- pdpi 5y agoYeah, and you can also have multiple loopback interfaces in the 127.0.0.0/8 range if you want, no reason why you can only have one. That said, enough stuff out there assumes localhost = 127.0.0.1 = loopback interface that I wouldn't want to make my life complicated by breaking the convention. Also, that comment was already a bit muc, and I opted to simplify a bit.