DNS in plain English
Stage 0 · Lesson 4 · 10 minutes · Requires Lessons 1–3
The one-line answer
DNS turns names people can remember into IP addresses machines can use. It is the internet's phone book — and it leaks more than most people realise.
Why you should care
You type google.com, not 142.250.183.14. Something has to translate between the two, and that something is DNS.
For security, DNS matters for three reasons:
- Recon — DNS records reveal an organisation's infrastructure without you ever touching their servers
- Attacks — DNS itself is abused for phishing, hijacking and data theft
- Defence — malware talking to its command server almost always makes DNS queries first, which is how blue teams catch it
DNS is the single richest source of free reconnaissance in security. Learn it properly.
How it actually works
You type example.com. Your machine needs an IP. Here's the chain:
- Browser cache — have I looked this up recently? If yes, done.
- Operating system cache — same question, one level down.
- Resolver — usually your ISP's server, or
8.8.8.8(Google) or1.1.1.1(Cloudflare). - Root servers — "I don't know
example.com, but here's who handles.com." - TLD servers — "I don't know the IP, but here's the nameserver for
example.com." - Authoritative nameserver — "Here is the IP address." (Run
dig example.combelow to see the real one — it changes over time.)
That whole journey happens in milliseconds, and the answer gets cached at every level on the way back.
Caching is why DNS changes take time to propagate. Each record carries a TTL (time to live) in seconds. Until that expires, caches keep serving the old answer.
Record types that matter
| Record | What it holds | Why security cares |
|---|---|---|
| A | IPv4 address | The basic name → IP mapping |
| AAAA | IPv6 address | Often forgotten in firewall rules |
| CNAME | Alias to another name | Dangling CNAMEs enable subdomain takeover |
| MX | Mail servers | Reveals email provider; phishing target |
| TXT | Arbitrary text | Holds SPF, DKIM, domain verification — leaks which services a company uses |
| NS | Nameservers | Shows who runs their DNS |
| SOA | Zone authority info | Admin contact, often a real email address |
| PTR | Reverse: IP → name | Used in log analysis |
TXT records are a recon goldmine. Companies verify ownership with services like Google Workspace, Atlassian, Zoom and dozens more by adding TXT records. Read them and you have a partial list of the company's software stack — for free, from anywhere.
Subdomains
mail.example.com, dev.example.com, staging.example.com, vpn.example.com — each is a separate host with its own records.
This is where beginners find real bugs. The main site is tested constantly. staging.example.com — set up two years ago, never patched, no WAF, with default credentials — often isn't. Subdomain enumeration is one of the highest-value skills in bug bounty.
See it yourself
Run these right now. They're read-only, they touch public infrastructure, and they're completely legal.
Basic lookup:
nslookup example.comBetter tool (Mac/Linux, or Windows with WSL):
dig example.comLook at specific record types:
dig example.com MX
dig example.com TXT
dig example.com NSTry the TXT records of a company you know. See what services they've revealed.
Reverse lookup:
dig -x 8.8.8.8Compare resolvers:
dig @1.1.1.1 example.com
dig @8.8.8.8 example.comSame answer? Usually. Sometimes not — and the difference is itself information.
These queries ask public DNS servers public questions. That's normal internet activity, not an attack. Enumerating subdomains at scale against a target you don't own is a different matter — Lesson 9 covers where the line sits.
How attackers abuse this
Subdomain enumeration. Tools brute-force thousands of possible subdomain names, or read certificate transparency logs (every HTTPS certificate ever issued is public record). The result: a map of the target's infrastructure, including things they forgot existed.
Subdomain takeover. A company points blog.example.com at a service like Heroku or GitHub Pages, then deletes the app but forgets the DNS record. The CNAME now points at nothing. An attacker registers that name on the same service and instantly controls a subdomain of a trusted brand — perfect for phishing, and it can steal cookies scoped to the parent domain.
DNS spoofing / cache poisoning. Trick a resolver into caching a wrong answer, and users are silently sent to an attacker's server while the URL still looks correct.
Typosquatting and homograph attacks. Register gooogle.com, or use Unicode characters that render identically to Latin ones. The user sees a familiar name and never suspects.
DNS tunnelling. Data is encoded into DNS queries — c2VjcmV0ZGF0YQ.attacker.com — and exfiltrated. Because DNS is almost never blocked, it's a favourite covert channel for malware. Detecting unusually long or high-volume DNS queries is a standard blue team hunt.
Zone transfer (AXFR). A misconfigured nameserver will hand over its entire zone file on request — every record, every subdomain, instantly. It's rare now, but still found, and it's a complete infrastructure map in one command.
Common mistakes
"DNS is encrypted because I use HTTPS." Traditionally it isn't. Classic DNS queries travel in plaintext, so anyone on the path sees every domain you visit even if the page content is encrypted. DoH (DNS over HTTPS) and DoT fix this, but they aren't universal.
"The padlock means the site is legitimate." It means the connection is encrypted. paypa1-secure.com can get a valid certificate in minutes. HTTPS proves nothing about who owns the domain.
"Subdomains are private." Certificate transparency logs make almost every subdomain with an HTTPS certificate publicly discoverable. There is no hiding by obscurity here.
Check yourself
- A company's TXT records mention
atlassian-domain-verificationandgoogle-site-verification. What have you learned? - Why is a CNAME pointing to a deleted cloud service dangerous?
- Malware on a network makes hundreds of DNS queries per minute to random-looking subdomains of one domain. What's likely happening?
Answers
- They use Atlassian products (Jira/Confluence) and Google Workspace. That tells you which login portals to look for and which phishing pretexts would be credible — useful recon obtained without touching their servers.
- Subdomain takeover. The DNS record still points at the service, but the resource is unclaimed. An attacker can register that name on the same platform and serve their own content from a subdomain of a trusted brand.
- DNS tunnelling — data being exfiltrated encoded inside DNS query names, or malware beaconing to a command-and-control server. The random-looking labels are encoded payloads.
Your lab
Challenge 03 — Find the hidden endpoint
Recon skills apply directly here. What exists that isn't linked from the main page?
→ Open Stage 0 labs
Summary in your language
தமிழ் சுருக்கம் (Tamil summary)
DNS என்றால் என்ன?
நீங்கள் google.com என்று டைப் செய்கிறீர்கள். ஆனால் கம்ப்யூட்டர்களுக்கு பெயர்கள் புரியாது — அவற்றுக்கு IP address தான் தேவை. இந்த பெயரை IP address ஆக மாற்றித் தருவது தான் DNS. இதை இணையத்தின் "தொலைபேசி புத்தகம்" என்று சொல்லலாம்.
முக்கியமான record வகைகள்:
- A record — பெயருக்கு உரிய IPv4 முகவரி
- MX record — அந்த நிறுவனத்தின் email server எது
- TXT record — நிறுவனம் எந்தெந்த services பயன்படுத்துகிறது என்பதை வெளிப்படுத்தும்
- CNAME — ஒரு பெயரை இன்னொரு பெயருக்கு இணைப்பது
பாதுகாப்பில் ஏன் முக்கியம்?
DNS records-ஐ படித்தாலே ஒரு நிறுவனத்தின் infrastructure பற்றி நிறைய தெரிந்துகொள்ளலாம் — அவர்களின் server-ஐ தொடாமலேயே. இதற்கு reconnaissance என்று பெயர்.
குறிப்பாக subdomains (staging.example.com, dev.example.com) — இவை பெரும்பாலும் பாதுகாப்பு சோதனை செய்யப்படாமல் இருக்கும். bug bounty-யில் அதிக bugs இங்கே தான் கிடைக்கின்றன.
கவனிக்க: HTTPS உள்ளது என்பதால் மட்டும் அந்த website பாதுகாப்பானது என்று அர்த்தமில்லை. போலி website-களும் HTTPS certificate வாங்க முடியும்.
हिंदी सारांश (Hindi summary)
DNS क्या है?
आप google.com टाइप करते हैं, लेकिन कंप्यूटर नाम नहीं समझते — उन्हें IP address चाहिए। नाम को IP address में बदलने का काम DNS करता है। इसे इंटरनेट की "फ़ोन बुक" कह सकते हैं।
ज़रूरी record types:
- A record — नाम का IPv4 पता
- MX record — कंपनी का email server कौन सा है
- TXT record — कंपनी कौन-कौन सी services इस्तेमाल करती है, यह पता चल जाता है
- CNAME — एक नाम को दूसरे नाम से जोड़ना
सुरक्षा में क्यों महत्वपूर्ण है?
सिर्फ़ DNS records पढ़कर ही किसी कंपनी के infrastructure के बारे में बहुत कुछ पता चल जाता है — बिना उनके server को छुए। इसे reconnaissance कहते हैं।
खास तौर पर subdomains (staging.example.com, dev.example.com) — इनकी सुरक्षा जाँच अक्सर नहीं होती। bug bounty में सबसे ज़्यादा bugs यहीं मिलते हैं।
ध्यान दें: HTTPS का ताला दिखने का मतलब यह नहीं कि website भरोसेमंद है। नक़ली websites भी HTTPS certificate ले सकती हैं।
Want this summary in Malayalam, Telugu, Kannada or another language? Tell us — the most requested languages get added next.
What's next
You know how a name becomes an address. Now let's read the address itself properly — because every part of a URL is an input, and inputs are where bugs live.
→ Lesson 5: How to read a URL like an attacker