Network Analysis

What is DNS?

The Internet's phone book: how DNS translates domain names into IP addresses.

1 Introduction

When you want to call a friend, you look up their name in your contacts and your phone finds the number for you. You do not need to remember it: the contact list does the translation. The Domain Name System (DNS) does exactly the same for the internet.

When you type www.google.com into your browser, your computer does not know where that website lives. It needs an IP address, such as 142.250.179.78, to connect to the server. DNS is the giant directory of the internet that translates domain names into IP addresses, billions of times a day. Because almost every connection starts with a DNS lookup, it is also a favorite target for attackers, and a goldmine of clues for defenders.

The phone book of the internet

You type

google.com

DNS translates it into

142.250.179.78

Your browser connects

Page loaded

Key DNS record types

A

Points to an IPv4 address

AAAA

Points to an IPv6 address

MX

Mail server for the domain

CNAME

Alias pointing to another name

2 How It Works

Use the domain analyzer below to inspect the DNS records of any domain and understand its infrastructure.

The DNS resolution process

When you type a domain name in your browser, a chain of lookups happens in a few milliseconds:

1

Local cache

Your browser and computer first check whether they recently looked up this domain. If so, they reuse the stored answer.

2

Recursive resolver

Otherwise, the question goes to a resolver: your internet provider's, or one you chose (such as 1.1.1.1, 8.8.8.8 or 9.9.9.9). It does the rest of the work on your behalf.

3

Root servers

The resolver asks a root server which servers handle the extension (.com, .org, .fr...). There are 13 named root servers (A to M), run by 12 organizations and copied in well over a thousand locations worldwide.

4

TLD servers

The servers of the extension point to the domain's own DNS servers (its NS records).

5

Authoritative server

The domain's DNS server gives the final answer, the IP address. The resolver passes it to your browser and keeps it in cache for a duration set by the TTL (Time To Live).

3 Detailed Analysis

DNS record types explained

Record Purpose Example Security relevance
A Points the name to an IPv4 address 192.0.2.10 Reveals the server's IP, whose reputation you can check
AAAA Points the name to an IPv6 address 2001:db8::10 Same as A, for IPv6 infrastructure
MX Mail server mail.example.com Shows which servers receive email; useful in phishing analysis
CNAME Alias to another name cdn.example.com Reveals shared infrastructure or third-party services; a forgotten alias can be hijacked
TXT Free text (SPF, DKIM, DMARC, ownership checks) v=spf1 include:... Reveals the domain's email authentication policies
NS Name servers ns1.example.com Shows who controls the domain's DNS; an unexpected change can signal a hijack

Email authentication records matter more than ever: since 2024, Gmail and Yahoo require bulk senders to authenticate their messages with SPF, DKIM and DMARC. A domain without them is easier to impersonate (see Spoofing techniques).

DNS poisoning and hijacking

Imagine someone edits your contact list so that your bank's number is replaced by a scammer's. That is what DNS poisoning does: the attacker corrupts a DNS cache so that your computer receives a fake IP address. Other attackers take over the DNS settings of a home router, or the account used to manage a domain, to achieve the same result.

You type your bank's address, the address bar looks normal, but you are connected to the attacker's server. Thanks to HTTPS, the browser will usually show a certificate warning in that case: it is often the only visible sign. Never click through such a warning on a sensitive site.

DNS-based security mechanisms

Classic DNS queries travel unencrypted: your internet provider, or anyone on the same public Wi-Fi, can see which sites you look up. Several mechanisms fix this and other weaknesses:

DNSSEC

Digitally signs DNS records so that resolvers can detect forged answers. It guarantees authenticity, not confidentiality.

DNS over HTTPS (DoH)

Encrypts DNS queries inside ordinary HTTPS traffic, like putting your directory lookup in a sealed envelope. Major browsers and operating systems support it, and some turn it on automatically.

DNS over TLS (DoT)

Same goal as DoH, on a dedicated port (853). It is what Android's "Private DNS" setting uses. Note: with DoH or DoT, the resolver you chose still sees your queries.

Protective DNS and sinkholes

Some resolvers (Quad9, for example) refuse to answer for known malicious domains, and security teams redirect malicious domains to a controlled server to cut malware off from its command-and-control infrastructure.

DNSSEC for your own domain

A domain scan checks whether your zone is signed and whether the chain of trust is complete: the root signs the TLD, the TLD publishes a DS record for your domain (set at your registrar), and that DS must match the DNSKEY published by your DNS provider. One missing link and the whole chain is ignored.

Not signed

The most common case, reported as low severity. Your records can be forged in transit without resolvers noticing. Worth fixing, rarely urgent.

Signed, but no DS at the registrar

The zone carries signatures but nobody vouches for the key. Validating resolvers treat it as unsigned: you have the work and none of the protection.

DS at the registrar, zone no longer signed

The dangerous one, typically after moving to a new DNS provider. Validating resolvers (Google Public DNS, Cloudflare, Quad9) answer SERVFAIL and your domain disappears for their users.

Turning it on

Most DNS providers sign the zone in one click and show you the DS values. Add them at your registrar, which is often automatic when both are the same company.

Changing DNS provider? Remove the DS at the registrar first, wait for its TTL to expire, then move, and re-enable DNSSEC at the new provider.

Try it on mlab.sh

Query the full DNS record set of any domain: A, AAAA, MX, TXT, NS, CNAME and more. See the records you just learned about and spot misconfigurations that could signal a compromise.

Scan DNS records on mlab.sh

4 Red Flags

Here are DNS-related warning signs that may indicate malicious activity:

Resolution to an unexpected IP

If a well-known domain suddenly points to an IP at an unusual host or in an unexpected country, its DNS, or yours, may have been tampered with. Compare with another resolver (1.1.1.1, 8.8.8.8 or 9.9.9.9).

Constantly changing IPs (fast flux)

A domain that resolves to many different IPs in quick succession, with a very short TTL, may be hiding malicious infrastructure behind a rotating set of compromised machines. Note that CDNs also use short TTLs legitimately: look at where the IPs belong.

No email authentication

A domain that sends you emails but has no SPF or DMARC record (and often no MX either) is poorly managed, disposable, or being impersonated. Established organizations configure email authentication.

Domain pointing to a residential IP

A website that resolves to a home broadband address is suspicious: legitimate services are hosted in datacenters or behind CDNs, not on someone's home router.

Unexpected redirections or certificate warnings

If familiar sites redirect you elsewhere or show certificate errors, but only on your home network, check your router's DNS settings: they may have been changed by an attacker.

DNS tunneling patterns

Very long or encoded-looking subdomains, or large volumes of TXT queries to the same domain, can indicate DNS tunneling: malware using DNS to talk discreetly with its server or to exfiltrate data.

CNAME pointing to a suspicious or abandoned name

A legitimate-looking subdomain whose CNAME points to a recently created domain, or to a cloud service that no longer exists, may have been taken over by an attacker (subdomain takeover) and used for phishing under a trusted name.

Related Modules