5kits zhao

Configuration of multiple DNS servers in origin-upstream-dns.conf

Contents

[ hide ]

    Issue
    How to configure primary and secondary upstream dns servers in /etc/dnsmasq.d/origin-upstream-dns.conf.
    You should configure multiple upstream DNS servers for eliminating A single point of failure (SPOF).
    Resolution
    You can configure multiple upstream DNS servers through NetworkManager.
    For example, If there are Primary DNS server: 192.168.68.68 and Secondary DNS server: 192.168.68.69, then you can configure as follows.
    Raw

    1. nmcli con mod eth0 ipv4.dns 192.168.68.68,192.168.68.69 # systemctl restart NetworkManager # systemctl restart dnsmasq # cat /etc/dnsmasq.d/origin-upstream-dns.conf server=192.168.68.68 server=192.168.68.69

    Root Cause
    First NetworkManager creates /etc/resolv.conf based on its configuration.
    Then /etc/NetworkManager/dispatcher.d/99-origin-dns.sh script would create a /etc/dnsmasq.d/origin-upstream-dns.conf based on /etc/resolv.conf which is just created by NetworkManager.
    Finally the /etc/resolv.conf is changed to point the node hosts by 99-origin-dns.sh.

    Leave a Reply