Telling Ubuntu what the local domain is

Chris Green cl at isbd.net
Sun May 17 07:58:46 UTC 2020


On Sun, May 17, 2020 at 09:06:50AM +0200, Nils Kassube wrote:
> Stuart McGraw wrote:
> > 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.
> 
> Here is a third approach: In my router (running openwrt) I set the local
> domain in the config of the DHCP server. Then I don't have to configure
> the local PCs again when I change the OS.
> 
Yes, I have a similar sort of approach, I have a LAN DHCP/DNS server
running dnsmasq on a Raspberry Pi.  Dnsmasq is flexible enough that I
can configure around the quirks of the mix of hardware (Android phones
and tablets, some MS Windows machines, a DECT base station, etc. etc.)
such that everything works and has a sensible name I can use to 'see'
it.

-- 
Chris Green




More information about the ubuntu-users mailing list