Skip to main content

Setting DNS

DNS-MNS can automatically configure DNS on Windows, macOS, and Linux. This page explains how DNS is set on each platform.

Automatic DNS Configuration

After testing DNS servers, you can apply one of the top results:
Would you like to apply one of these DNS servers? (y/n): y
Enter selection (1-3): 1
The tool automatically detects your operating system and uses the appropriate method.

Platform-Specific Methods

DNS-MNS supports multiple Linux DNS management systems:

systemd-resolved (Default on Ubuntu 18.04+, Fedora, etc.)

Creates a configuration file at /etc/systemd/resolved.conf.d/dns-mns.conf:
[Resolve]
DNS=1.1.1.1 1.0.0.1
Then restarts the service:
sudo systemctl restart systemd-resolved

NetworkManager

Uses nmcli to configure the active connection:
nmcli connection modify "Your Connection" ipv4.dns "1.1.1.1 1.0.0.1"
nmcli connection modify "Your Connection" ipv4.ignore-auto-dns yes
nmcli connection up "Your Connection"

Fallback (resolv.conf)

If neither systemd-resolved nor NetworkManager is available:
# Backs up existing configuration
cp /etc/resolv.conf /etc/resolv.conf.backup

# Writes new DNS
echo "nameserver 1.1.1.1" > /etc/resolv.conf
echo "nameserver 1.0.0.1" >> /etc/resolv.conf

Manual DNS Configuration

You can also set DNS manually using option 2 from the main menu:
[ SET CUSTOM DNS ]

Choose DNS server or enter custom:

  [1]  Cloudflare (1.1.1.1)
  [2]  Google (8.8.8.8)
  [3]  Shecan (178.22.122.100)
  ...
  [99] Enter custom DNS

Enter your choice:

Using Custom DNS

Select option 99 to enter custom DNS IPs:
Enter primary DNS: 1.2.3.4
Enter secondary DNS (or press Enter to skip): 5.6.7.8

Verifying DNS Changes

After setting DNS, verify it’s working:
# Check current DNS
resolvectl status

# Or
cat /etc/resolv.conf

# Test resolution
dig google.com

Making DNS Persistent

By default, DNS changes made by DNS-MNS are persistent. However, some systems may reset DNS on reboot.
For NetworkManager:
sudo nmcli connection modify "Your Connection" ipv4.ignore-auto-dns yes
For systemd-resolved: The configuration file at /etc/systemd/resolved.conf.d/ is automatically persistent.

Administrator Privileges

DNS-MNS automatically requests elevated privileges when needed:
  • Linux/macOS: Prompts for sudo password
  • Windows: Requires running as Administrator
If you see “Permission denied”, run the tool with elevated privileges:
# Linux/macOS
sudo dns-mns

# Windows: Right-click terminal -> Run as Administrator