Should I log my journey through linuxquestions.org?
Let's go...
Let's go...
Keeping /etc/hosts up to date (dhcp)
Tags incomplete
When you get your IP address using DHCP in a domain your /etc/hosts file, as well as /etc/networks might get out of sync with reality.
If I plug my laptop to the wifi network at the library, for example, my /etc/hosts has a line like the following one:
Where, in fact, it should be something like:
The same thing happens to /etc/networks where a line like the following one should be added:
and removed after the DHCP release.
I posted the question to the Linux - Networking forum in this thread: keep /etc/hosts up to date (dhcp) in the hope that someone might have an answer...
zrong suggested to point my hostname to my loopback interface so it could always be found, as well as information about IPv6 networking that I am not prepared to take into consideration just yet, but then tools like domainname or login won't know the correct domain to show.
I know ping would work, but...
computersavvy rightly pointed out that having the local domain name appear on the login screen would be (almost) a magic trick since the laptop would have no communication with that network before the DHCP handshake.
zrong, again, pointed me to the debian wiki network configuration page (side note: Should debian be spelled with a Capital "D", maybe even with both capital "D" and "I"?... Just a provoking thought).
zrong mentioned, as well, that a line with reference to 127.0.1.1 in /etc/hosts is Debian specific. I remember seeing a reference to it stating something like being needed by gnome. I don't have it and haven't seen any negative consequences.
It's, maybe, a good question to pose to the Debian social group.
zrong finally mentions how to completely disable IPv6, which I had already partially done.
If I plug my laptop to the wifi network at the library, for example, my /etc/hosts has a line like the following one:
Code:
192.168.0.10 myhost.example.com myhost
Code:
192.168.13.100 myhost.ourlibrary.org myhost
Code:
192.168.13.0 ourlibrary.org
I posted the question to the Linux - Networking forum in this thread: keep /etc/hosts up to date (dhcp) in the hope that someone might have an answer...
zrong suggested to point my hostname to my loopback interface so it could always be found, as well as information about IPv6 networking that I am not prepared to take into consideration just yet, but then tools like domainname or login won't know the correct domain to show.
I know ping would work, but...
computersavvy rightly pointed out that having the local domain name appear on the login screen would be (almost) a magic trick since the laptop would have no communication with that network before the DHCP handshake.
zrong, again, pointed me to the debian wiki network configuration page (side note: Should debian be spelled with a Capital "D", maybe even with both capital "D" and "I"?... Just a provoking thought).
zrong mentioned, as well, that a line with reference to 127.0.1.1 in /etc/hosts is Debian specific. I remember seeing a reference to it stating something like being needed by gnome. I don't have it and haven't seen any negative consequences.
It's, maybe, a good question to pose to the Debian social group.
zrong finally mentions how to completely disable IPv6, which I had already partially done.
Total Comments 0