How to Check DNS for a Domain DerrellUpdated on July 21, 2026 3 Minute Read When a site is unreachable or email stops flowing, the first thing to verify is what Domain Name System (DNS) records are actually live on the internet. This guide shows you how to check DNS for a domain from your terminal using whois and dig, so you can confirm nameservers, inspect individual record types, and query a specific nameserver directly. Replace <your-domain> with the actual domain name in every command below. Check Domain Registration and Nameservers with whois The whois command returns registration details for a domain: the registrar, expiration date, and the nameservers the domain is delegated to. Run it first to confirm which nameservers are authoritative before you dig into individual records. whois <your-domain> Look for the Name Server lines in the output. Those are the servers responsible for answering DNS queries for the domain. If they are not pointing to InMotion Hosting nameservers (for example, ns1.inmotionhosting.com), DNS changes made inside cPanel will not be visible on the public internet until the domain is re-delegated. Tip: You can also look up registration details in a browser at whois.com without opening a terminal. Check DNS for a Domain with dig The dig command queries DNS and displays the records currently propagated on the public internet. By default, it returns the A record, which is the domain’s IPv4 address. dig <your-domain> The ANSWER SECTION of the output shows the current A record. If the IP address does not match your server, the record has not propagated yet, or the DNS zone has an error. Tip: whatsmydns.net shows propagation status across many global resolvers at once, which is useful for spotting regional propagation delays. Check a Specific DNS Record Type To look up a record type other than A, add the type between dig and the domain name. Common types are mx (mail routing), cname (aliases), and txt (SPF, DKIM, and domain verification records). dig mx <your-domain> Swap mx for any record type you need to inspect. For example, dig txt <your-domain> returns all TXT records, which is useful for verifying SPF and DKIM configuration. Query a Specific Nameserver Directly Sometimes you need to see what a particular nameserver is serving rather than what your local resolver returns. Adding @<nameserver> to the command sends the query directly to that server, bypassing your local DNS cache. dig @<nameserver> <your-domain> For example, to check what InMotion Hosting’s primary nameserver is serving for your domain, run: dig @ns1.inmotionhosting.com <your-domain> If this returns the correct record but a public resolver does not, propagation is still in progress. If this returns no record, the zone on the InMotion nameserver has an issue and you should review the DNS zone editor in cPanel. Troubleshooting whois or dig is not installed On macOS, both tools are included with the operating system. On Linux, install them with your package manager: sudo apt install whois dnsutils on Debian or Ubuntu, or sudo dnf install whois bind-utils on AlmaLinux or CentOS. On Windows, use the Windows Subsystem for Linux (WSL) or an online tool such as whois.com. dig returns NXDOMAIN or SERVFAIL NXDOMAIN means no DNS record of that type exists for the domain. Check the DNS zone editor in cPanel to confirm the record is present and correctly formatted. SERVFAIL indicates the nameserver encountered an error answering the query, which can happen if the zone file has a syntax error or the nameserver itself is unreachable. If the zone looks correct in cPanel, open a support ticket so the InMotion team can inspect the nameserver configuration. Conclusion With whois and dig you can check DNS for a domain at every layer: registration and delegation, propagated public records, specific record types, and nameserver-level responses. If you find that records are incorrect, edit the DNS zone directly in cPanel. For related network diagnostics, see How to Check if a Port is Blocked with Telnet and Check if a Port is Blocked with Netcat / Ncat. Summarize and Research with AIShare on Social Media Derrell Willis Manager, Developer Relations More Articles by Derrell Related Articles How to Check DNS for a Domain InMotion Hosting Nameservers Look Up DNS History With SecurityTrails How to Change Your Domain Nameservers in AMP How To Fix the “DNS Server Not Responding” Error on Windows and Mac Wildcard Subdomains and DNS How to Set Up Custom Nameservers for Resellers Using Custom Nameservers Domain Names – Registrar Transfer versus NameServer Change How Do I Clear My Local DNS Cache?