Command: dns

Manage DNS (Domain Name System) settings on macOS.

Usage

Usage:  m dns [OPTIONS]

Description:  Manage DNS settings on macOS

Options:
  --help                Show this help message
  --list                List current DNS servers
  --flush               Flush local DNS cache
  --add IP|HOSTNAME     Add a DNS server by IP or hostname

Options

--list

Lists the DNS servers currently configured in /etc/resolv.conf.

Example:

m dns --list
# Output:
# List of the DNS servers:
# 8.8.8.8
# 1.1.1.1

--flush

Clears the local DNS cache. This is useful when you've made changes to your network settings or are experiencing issues resolving domain names. Requires sudo privileges.

Example:

m dns --flush

--add IP|HOSTNAME

Adds a new DNS server to your system's configuration. This action requires sudo privileges.

Example:

# Add Google's public DNS server
m dns --add 8.8.8.8

# Add Cloudflare's public DNS server
m dns --add 1.1.1.1