Whether you're verifying a DNS change has taken effect, debugging email delivery problems, checking nameservers before a migration, or just inspecting how another domain is configured, knowing how to query DNS records is a core skill. This guide covers browser-based tools, command-line methods, and how to interpret what you see.
No installation needed, these work from any device.
dig is the standard DNS lookup tool on Unix systems. It's pre-installed on macOS and available in any Linux distribution. Open Terminal and use the following commands.
Look up an A record (IPv4 address):
dig yourdomain.com A
Get just the IP without the verbose output:
dig yourdomain.com A +short
Look up nameservers:
dig yourdomain.com NS +short
Look up MX records (email routing):
dig yourdomain.com MX +short
Look up TXT records (SPF, DKIM, domain verification):
dig yourdomain.com TXT +short
Check a DMARC record:
dig _dmarc.yourdomain.com TXT +short
Query a specific DNS server directly (bypasses your local cache and ISP resolver):
dig @8.8.8.8 yourdomain.com A +short
Query the authoritative nameserver directly (confirms the record at the source, not cached):
dig @ns1.hosted-server.net yourdomain.com A +short
Look up all record types at once (note: not all providers honour the ANY query type):
dig yourdomain.com ANY
nslookup comes pre-installed on Windows and is also available on Mac and Linux. Open Command Prompt on Windows or Terminal on Mac/Linux.
Basic A record lookup:
nslookup yourdomain.com
Look up a specific record type:
nslookup -type=MX yourdomain.com nslookup -type=NS yourdomain.com nslookup -type=TXT yourdomain.com
Query a specific DNS server:
nslookup yourdomain.com 8.8.8.8
Interactive mode (enter multiple queries without retyping the command):
nslookup > set type=MX > yourdomain.com > set type=TXT > yourdomain.com > exit
The dig output can look verbose at first. The important sections are:
A full answer section example:
;; ANSWER SECTION: yourdomain.com. 3542 IN A 93.184.216.34
This reads as: yourdomain.com has an A record with 3542 seconds remaining in cache, pointing to 93.184.216.34.
After making a DNS change, the workflow for confirming it's working:
dig @ns1.hosted-server.net yourdomain.com A +shortdig @8.8.8.8 yourdomain.com A +shortIf the authoritative nameserver returns the correct value but public resolvers don't, your change is correct, resolvers are just waiting for cached records to expire based on the previous TTL.
Every HostBible hosting account includes full DNS zone management. Add, edit, and verify records directly from the control panel. Register a domain to get started.
Register a Domain