[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: Revisiting the hostname/FQDN issue, adding libnss-myhostname



On Mon, Oct 13, 2025 at 11:56:21PM +0200, Timo Röhling wrote:
The usual "trick" to get your own domain name is via hostname canonicalization, i.e, you run gethostbyname("apollo"), which returns 127.0.1.1, and afterwards gethostbyaddr(127.0.1.1), which returns "apollo.example.com". The 127.0.1.1 entry in /etc/hosts makes this work and still lets the software on your computer behave exactly as if your computer had a static IP with a proper DNS entry, regardless of your actual network setup.

That would work with 127.0.0.2 as well, right?

If you ask me, the roaming client is the more problematic case, as you need to have a well-defined FQDN to generate the /etc/hosts entry. I suppose it can be a bit awkward if you want the domain name to be configured dynamically and the DHCP client has to rewrite /etc/hosts each time you connect to a network, which is probably why systemd is exploring alternative resolution mechanisms.

I agree. I must say that I don't have that problem since my roaming clients connect to a VPN and get a static IPv6 address assigned from there, and that's what I use as the FQDN.

Greetings
Marc


--
-----------------------------------------------------------------------------
Marc Haber         | "I don't trust Computers. They | Mailadresse im Header
Leimen, Germany    |  lose things."    Winona Ryder | Fon: *49 6224 1600402
Nordisch by Nature |  How to make an American Quilt | Fax: *49 6224 1600421


Reply to: