You are not logged in.
Hi All,
I'm trying to add a domain (say `domain.com`) to my DNS search for all interfaces and wifi connections. So I'd like to type
ping host
and have it search for `host.domain.com`. In the old days I would edit `/etc/resolv.conf` and add the line:
search domain.com
and it would work. Now (after switching to `NetworkManager`, and `systemd-resolved`) it doesn't work anymore.
I can make it work on one particular connection by setting `ipv4.dns-search` and `ipv6.dns-search` to `domain.com`. But I have to do this for every single wifi network I connect to, which gets tiring.
Is there a simple way to fix this?
Thanks in advance
Last edited by gi1242 (2023-03-19 14:42:29)
Offline
https://wiki.archlinux.org/title/System … cal_domain
Fall back to using glibc's dns instead of using systemd's resolve
Offline
Thanks a lot! That's exactly what I needed.
I edited `/etc/nsswitch.conf` and made the following changes:
#hosts: mymachines resolve [!UNAVAIL=return] files myhostname dns
hosts: mymachines files myhostname dns resolve [!UNAVAIL=return]
I don't know what I'm losing by using glibc's DNS over systemd resolve...
I also realized from the link you posted that I can use /etc/hosts, and resolve it statically. There are like 10 host names I use often, so I'll probably just use that.
Thanks again.
Offline