brewedbits.dev

Personal blog with guides and news on selfhosting, Linux and AI, from the Netherlands

nextDash nextdash --aboutYour bookmarks. Your terminal. checks your links knows your Docker host one container, no cloudLive demo →nextdash.cc ↗

Tip: dig -p queries a resolver that listens on another port

Dig
~/tips/tip-dig-p-custom-port

dig -p 5335 @127.0.0.1 example.com +short

Queries a DNS server that runs on a port other than 53.

Unbound, dnsmasq and similar tools often listen on a port like 5335 behind Pi-hole or AdGuard Home. dig has to be told about that.

dig -p 5335 @127.0.0.1 example.com +short

-p sets the port for the query, and @127.0.0.1 picks the server. Without it, dig talks to port 53 and you end up testing the wrong service. This is a quick way to compare what the front resolver returns and what the upstream behind it returns. Use ss -lunp first if you do not know which port the daemon uses.

Further reading: dig manual page

Going deeper: Guide: dig for beginners, look up DNS records and read the answer

More Dig tips dig +noall +answer DS example.com dig nope.iana.org @9.9.9.9 | grep -E 'status|SOA' dig +search nas dig @8.8.8.8 www.google.com +subnet=203.0.113.0/24 dig +yaml example.com A All Dig tips (36) All topics

Link