Four ways to define domain searches

take a pick depending on your distro

dhclient

draft, apparently this isn’t enough and the router keeps defining additional domain-search

add some domain searches for DHCP sessions, e.g.

cd /etc/dhcp/
cp -pi dhclient.conf dhclient.conf.dist
vi dhclient.conf

remove domain-name, domain-search, host-name,
remove dhcp6.domain-search, dhcp6.fqdn,

prepend domain-search "example.com", "example.local";

dhclient -r
dhclient -v eth0

resolvconf

change the resolvconf config directly

    cd /etc/resolvconf/resolv.conf.d/
    cp -pi base base.dist
    vi base

    search example.com

also make sure that the local system hostnames resolves itselfs as FQDN accordingly (it can point to 127.0.0.1 on a desktop)

ubuntu – using the gui

Control Center -> Network --> (general tab) Domain name: ...
Control Center -> Network --> (DNs tab) Search domains: ...

ubuntu – systemd-resolved

in case you wanna keep the wrapper against dynamic name resolution AND search against your domain

cp -pi /etc/systemd/resolved.conf /etc/systemd/resolved.conf.dist
vi /etc/systemd/resolved.conf

Domains=DOMAIN.TLD

systemctl restart systemd-resolved.service
resolvectl status
cat /etc/resolv.conf

HOME | GUIDES | LECTURES | LAB | SMTP HEALTH | HTML5 | CONTACT
Copyright © 2024 Pierre-Philipp Braun