In the past, I've set up Dnsmasq for local development sites. It works by redirect certain TLD, for example, .dev to localhost IP address, The approach works if you're just running Dnsmasq service only. For those running Dnsmasq through NetworkManager, you'll need to setup it up slightly differently. Steps as follows.

Add the .dev generic Top Level Domain (gTLD) we want to redirect to localhost.
$ sudo echo "address=/dev/" > /etc/NetworkManager/dnsmasq.d/tld.dev

Restart the NetworkManger service.
$ sudo systemctl restart network-manager

Try and ping any domain with TLD of .dev.
$ ping -c 4 kianmeng.dev
PING kianmeng.dev ( 56(84) bytes of data.
64 bytes from icmp_seq=1 ttl=64 time=0.077 ms
64 bytes from icmp_seq=2 ttl=64 time=0.106 ms
64 bytes from icmp_seq=3 ttl=64 time=0.091 ms
64 bytes from icmp_seq=4 ttl=64 time=0.096 ms

--- kianmeng.dev ping statistics ---
4 packets transmitted, 4 received, 0% packet loss, time 2999ms
rtt min/avg/max/mdev = 0.077/0.092/0.106/0.014 ms

But wait, isn't we just configured any domains end with .dev will be resolved to IP address of How come it was resolved to instead? It seems, this particular unique IP address appeared to indicate a possible name collision issue. To quote ICANN site,
" is a special IPv4 address that will appear in system logs alerting system administrators that there is potential name collision issue, enabling a quick diagnosis and remediation. The "53" is used as a mnemonic to indicate a DNS-related problem owing to the use of network port 53 for the DNS service."
We can find more details by checking it using dig command.
$ dig kianmeng.dev TXT +short
"Your DNS configuration needs immediate attention see https://icann.org/namecollision"

In other words, the IP address is an notification to System Administrator to take note that the .dev generic Top Level Domain (gTLD) will be availabe in global DNS server.

No comments:

Post a Comment