Table of Contents

NetworkManager DNS Configuration

Configure NetworkManager DNS settings to use reliable DNS servers (Google DNS + local router) while preventing automatic DHCP overwrites.
This ensures stable DNS resolution for both general networking and Docker operations.

Main Commands

sudo nmcli con mod p8p1 ipv4.dns "8.8.8.8 8.8.4.4 192.168.1.1"
sudo nmcli con mod p8p1 ipv4.ignore-auto-dns yes
sudo nmcli con up p8p1

Explanations

First command sets DNS servers in preferred order:

Second command prevents DHCP DNS overwriting:

Third command activates new settings:

Verification

To verify configuration:

nmcli con show p8p1 | grep dns
cat /etc/resolv.conf
  • Replace p8p1 with your network interface name
  • You can see available interfaces with nmcli con show
  • Configuration persists after reboot
  • Helps resolve Docker image pull issues and DNS resolution problems.