host's fqdn not resolving
Stuart McGraw
smcg4191 at mtneva.com
Sat Aug 20 23:41:12 UTC 2022
As usual, when I have to deal with network host names, I end up in a
quagmire of confusion...
Situation:
* I have a local network with existing hosts with domain names ending
in ".home" and a local dns server that serves ip addresses for those
names properly, eg 'host old-host.home' returns the proper ip address
(eg 192.168.2.10).
* I've set up a new host (VM if it matters) with Ubuntu-22.04 with a
hostname of (say) "new-host". (It is actually Ubuntu server and is
configured with Netplan, not NetworkManager but I don't think that
matters).
* It gets an ip address and dns server address (of the local dns server)
via dhcp. It can reach existing hosts by name, eg 'ping old-host.home',
successfully.
* Existing hosts like old-host.home can communicate with it successfully
using it's dhcp-assigned address, eg 'ssh me at 192.168.2.140'.
* Existing hosts cannot reach it by name since there in no entry in
the dns server for it.
* On new-host itself, 'host new-host' resolves to 127.0.1.1 and is
pingable.
All that's good and expected.
Problem:
On new-host 'ping new-host' works but 'ping newhost.home' produces
the error, "Name or service not known"; 'host new-host.home' says
"new-host.home not found: 3(NXDOMAIN)"). I suppose this is because
it is asking the local network dns server which knows nothing about
the name.
This is a problem because I have various scripts and software that I
will migrate to new-host that expect new-host.home to be resolvable.
Request:
I want to know what configuration change I need to make *on new-host*
so the machine's own fqdn (new-host.home) will resolve, on itself only,
to its dhcp assigned address.
Surely with systemd-resolved, avahi, mdns, nsswitch,conf, /etc/hosts
and probably a half dozen other pieces involved, there must be some
magical configuration change that can achieve this?
I have tried (really just stabs in the dark) setting:
/etc/systemd/resolved.conf: Domains=home
and:
/etc/avahi/avahi-daemon.conf: domain-name=home
but neither had the desired effect.
Thanks and everlasting gratitude for a solution (or even a hint
towards one)!
More information about the ubuntu-users
mailing list