Telling Ubuntu what the local domain is

Stuart McGraw smcg4191 at mtneva.com
Sun May 17 05:37:09 UTC 2020


Hello,

My Ubuntu machine (running Ubuntu-20.04 Server) is on a local network with the domain ".home".  It is using the standard systemd-resolved resolver.  It has a hostname (in /etc/hostname) of "foo".

If I ping another host on the local network, say "boo", I have to refer to it as "boo.home"; just doing "ping boo" fails with the error, "temporary failure in name resolution".

I found I can fix this in two ways:

1. Change the hostname in /etc/hostname from "foo" to "foo.home".

or

2. Add the line "search home" to /etc/resolv.conf.  (Actually this is done indirectly by adding the line "domain=home" to /etc/systemd/resolved.conf; systemd then adds the "search home" line to /etc/resolv.conf.)

My question is: which of those two ways (or some other way?) is better, and why?




More information about the ubuntu-users mailing list