Skip to main content
deleted 2 characters in body
Source Link
cas
  • 84.9k
  • 9
  • 138
  • 207

Like many of the not-actually-init1 things that systemd attempts to do, it's a half-arsed and broken implementation. Your best option is to avoid it entirely:

  1. Install a caching DNS resolver (e.g. unbound) on the same machine that provides DHCP service to your LAN.

    • If you're using dnsmasq as your DHCP server, it is capable of both DNS resolution AND DHCP (and PXE & TFTP too), so it's just a matter of enabling and configuring both features. dnsmasq is suitable for small to medium sized networks, and is often used to provide these services to VMs (e.g. with kvm and/or libvirt), and is frequently used on small linux-based routers, xDSL modems, and wireless access-points.

    • If you're using some other DHCP server, such as ISC's (deprecated but still useful) isc-dhcpd or ISC's newer kea, then use unbound for DNS resolution and caching.

    • BTW, as an added benefit, DNS lookups will be faster because you have a cache on your local network serving all local client machines.

    BTW, as an added benefit, DNS lookups will be faster because you have a cache on your local network serving all local client machines.

  2. Configure the DNS resolver to forward unknown (i.e. not in the local cache) requests to your upstream DNS servers (e.g. 10.10.0.100, 10.10.0.101, and 10.0.0.1).

  3. Configure your DHCP server to tell client machines to use its IP address for DNS resolution.

  4. Disable and uninstall systemd-resolved on all client machines.


1 Systemd unit files aren't a bad way of doing init (i.e. starting, stopping, restarting services), in fact it's pretty good at that - but everything else it tries to do is garbage, inflexible and barely functional minimum viable products focused on the developers' own needs rather than those of the users'.

Like many of the not-actually-init1 things that systemd attempts to do, it's a half-arsed and broken implementation. Your best option is to avoid it entirely:

  1. Install a caching DNS resolver (e.g. unbound) on the same machine that provides DHCP service to your LAN.

    • If you're using dnsmasq as your DHCP server, it is capable of both DNS resolution AND DHCP (and PXE & TFTP too), so it's just a matter of enabling and configuring both features. dnsmasq is suitable for small to medium sized networks, and is often used to provide these services to VMs (e.g. with kvm and/or libvirt), and is frequently used on small linux-based routers, xDSL modems, and wireless access-points.

    • If you're using some other DHCP server, such as ISC's (deprecated but still useful) isc-dhcpd or ISC's newer kea, then use unbound for DNS resolution and caching.

    • BTW, as an added benefit, DNS lookups will be faster because you have a cache on your local network serving all local client machines.

  2. Configure the DNS resolver to forward unknown (i.e. not in the local cache) requests to your upstream DNS servers (e.g. 10.10.0.100, 10.10.0.101, and 10.0.0.1).

  3. Configure your DHCP server to tell client machines to use its IP address for DNS resolution.

  4. Disable and uninstall systemd-resolved on all client machines.


1 Systemd unit files aren't a bad way of doing init (i.e. starting, stopping, restarting services), in fact it's pretty good at that - but everything else it tries to do is garbage, inflexible and barely functional minimum viable products focused on the developers' own needs rather than those of the users'.

Like many of the not-actually-init1 things that systemd attempts to do, it's a half-arsed and broken implementation. Your best option is to avoid it entirely:

  1. Install a caching DNS resolver (e.g. unbound) on the same machine that provides DHCP service to your LAN.

    • If you're using dnsmasq as your DHCP server, it is capable of both DNS resolution AND DHCP (and PXE & TFTP too), so it's just a matter of enabling and configuring both features. dnsmasq is suitable for small to medium sized networks, and is often used to provide these services to VMs (e.g. with kvm and/or libvirt), and is frequently used on small linux-based routers, xDSL modems, and wireless access-points.

    • If you're using some other DHCP server, such as ISC's (deprecated but still useful) isc-dhcpd or ISC's newer kea, then use unbound for DNS resolution and caching.

    BTW, as an added benefit, DNS lookups will be faster because you have a cache on your local network serving all local client machines.

  2. Configure the DNS resolver to forward unknown (i.e. not in the local cache) requests to your upstream DNS servers (e.g. 10.10.0.100, 10.10.0.101, and 10.0.0.1).

  3. Configure your DHCP server to tell client machines to use its IP address for DNS resolution.

  4. Disable and uninstall systemd-resolved on all client machines.


1 Systemd unit files aren't a bad way of doing init (i.e. starting, stopping, restarting services), in fact it's pretty good at that - but everything else it tries to do is garbage, inflexible and barely functional minimum viable products focused on the developers' own needs rather than those of the users'.

Source Link
cas
  • 84.9k
  • 9
  • 138
  • 207

Like many of the not-actually-init1 things that systemd attempts to do, it's a half-arsed and broken implementation. Your best option is to avoid it entirely:

  1. Install a caching DNS resolver (e.g. unbound) on the same machine that provides DHCP service to your LAN.

    • If you're using dnsmasq as your DHCP server, it is capable of both DNS resolution AND DHCP (and PXE & TFTP too), so it's just a matter of enabling and configuring both features. dnsmasq is suitable for small to medium sized networks, and is often used to provide these services to VMs (e.g. with kvm and/or libvirt), and is frequently used on small linux-based routers, xDSL modems, and wireless access-points.

    • If you're using some other DHCP server, such as ISC's (deprecated but still useful) isc-dhcpd or ISC's newer kea, then use unbound for DNS resolution and caching.

    • BTW, as an added benefit, DNS lookups will be faster because you have a cache on your local network serving all local client machines.

  2. Configure the DNS resolver to forward unknown (i.e. not in the local cache) requests to your upstream DNS servers (e.g. 10.10.0.100, 10.10.0.101, and 10.0.0.1).

  3. Configure your DHCP server to tell client machines to use its IP address for DNS resolution.

  4. Disable and uninstall systemd-resolved on all client machines.


1 Systemd unit files aren't a bad way of doing init (i.e. starting, stopping, restarting services), in fact it's pretty good at that - but everything else it tries to do is garbage, inflexible and barely functional minimum viable products focused on the developers' own needs rather than those of the users'.