Telling Ubuntu what the local domain is
Stuart McGraw
smcg4191 at mtneva.com
Sun May 17 17:49:21 UTC 2020
On 5/17/20 1:58 AM, Chris Green wrote:
> 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.
Thanks for those suggestions.
My bad, I left out an important detail... the machines I asked the question
behalf of are configured with static IPs. I do use DHCP (supplying domain
in addition to the other stuff) for other machines. And I realize I could
assign static addresses in DHCP for these machines but I want them to be as
independent of any external services as possible. (They have hosts file
entries for other critical machines rather than being dependent on DNS for
example.)
A second reason for asking is that I am utterly confused by how systemd and
traditional network configuration works (or doesn't) together.
More information about the ubuntu-users
mailing list