DNS stands for:
Domain Name System
Think of it as the Internet's phonebook.
DNS Resolution
When a browser needs:
operatoronthewire.com
it performs a lookup.
Browser
↓
DNS Server
↓
Returns IP Address
Example:
operatoronthewire.com
↓
104.21.96.1
Browser then connects to:
104.21.96.1
DNS Resolution Flow
Simplified:
User
↓
Local DNS Cache
↓
Configured DNS Server
↓
Internet DNS Infrastructure
↓
Answer Returned
Common DNS Servers
Public DNS providers:
8.8.8.8
Google DNS
1.1.1.1
Cloudflare DNS
9.9.9.9
Quad9
The Hosts File
Before DNS is consulted, the operating system checks:
Windows:
C:\Windows\System32\drivers\etc\hosts
Linux:
/etc/hosts
Example:
10.10.10.10 dc-1.corp.local
The operating system will use this entry instead of querying DNS.
DNS Records
DNS stores different types of records.
A Record
Maps a hostname to an IPv4 address.
portal.operatoronthewire.com
↓
104.21.96.1
AAAA Record
Maps a hostname to an IPv6 address.
portal.operatoronthewire.com
↓
2606:4700::6815:6001
CNAME Record
Creates an alias.
www.operatoronthewire.com
↓
operatoronthewire.com
MX Record
Mail server.
operatoronthewire.com
↓
mail.operatoronthewire.com
Used for email delivery.
NS Record
Specifies authoritative DNS servers.
Example:
ns1.provider.com
ns2.provider.com
TXT Record
Stores arbitrary text.
Common uses:
SPF
DKIM
Domain Verification
Examples:
google-site-verification
v=spf1 include:_spf.google.com
DNS Tools
Windows:
Resolve-DnsName operatoronthewire.com
Linux:
dig operatoronthewire.com
Linux:
host operatoronthewire.com
Linux:
nslookup operatoronthewire.com
Example Lookup
dig operatoronthewire.com
Output:
operatoronthewire.com. 300 IN A 104.21.96.1
Meaning:
A Record
↓
104.21.96.1