To start we have to disable systemd-resolved because it is already using the 53 port (DNS port). You need to run this as the root user (sudo didn’t work for me)
# systemctl disable systemd-resolved
# systemctl mask systemd-resolved
Make sure to reboot your container. Now we can install dnsmasq simply with :
apt install dnsmasq
Now let’s configure dnsmasq. To do this we have to edit the /etc/dnsmasq.conf file.
# nano /etc/dnsmasq.conf
domain-needed
bogus-priv
filterwin2k
no-poll
no-resolv
server=9.9.9.9
server=1.1.1.1
local=/example.ch/
interface=eth0
domain=example.ch
dhcp-range=172.16.10.101,172.16.10.201,48h
dhcp-option=option:router,172.16.0.1
dhcp-lease-max=150
dhcp-authoritative
listen-address=127.0.0.1
cache-size=500
no-negcache
dhcp-host=44:FE:3B:F9:14:E1,172.16.0.1,router
And that is all ! Don’t hesitate to post comments or questions 🙂