DNS (Domain Name System) , domain isimlerini IP adreslerine çeviren, internetin telefon rehberi olarak adlandırılan sistemdir. İnsanların domain isimlerini (google.com) hatırlamasını, IP adreslerini (142.250.185.46) hatırlamasını sağlar.
1. Tarayıcı → DNS Resolver (ISP DNS)
2. DNS Resolver → Root DNS Server
3. Root DNS → TLD DNS Server (.com)
4. TLD DNS → Authoritative DNS Server (hedef.com)
5. Authoritative DNS → IP Adresi
6. IP Adresi → Tarayıcı
# Temel sorgu
nslookup google.com
# Farklı DNS sunucusu ile
nslookup google.com 8.8.8.8
# Ters sorgu
nslookup 8.8.8.8
# Kayıt türü belirtme
nslookup -type=MX google.com
nslookup -type=NS google.com
nslookup -type=TXT google.com
# DNS cache temizleme
ipconfig /flushdns
# Temel sorgu
dig google.com
dig google.com A
# Farklı DNS sunucusu ile
dig @8.8.8.8 google.com
# Ters sorgu
dig -x 8.8.8.8
# Kayıt türü belirtme
dig google.com MX
dig google.com NS
dig google.com TXT
# DNS cache temizleme
sudo systemd-resolve --flush-caches
# DNSSEC sorgusu
dig +dnssec google.com
# DNSSEC doğrulama
dig +sigchase google.com
# DNS Zone Transfer (AXFR)
dig axfr @ns1.hedef.com hedef.com
nslookup -type=any -query=AXFR hedef.com ns1.hedef.com
# Subdomain enumeration
dnsrecon -d hedef.com
dnsenum hedef.com
# DNS Brute Force
dnsrecon -d hedef.com -D subdomains.txt
DNS Çalışma Prensibi
text1. Tarayıcı → DNS Resolver (ISP DNS)
2. DNS Resolver → Root DNS Server
3. Root DNS → TLD DNS Server (.com)
4. TLD DNS → Authoritative DNS Server (hedef.com)
5. Authoritative DNS → IP Adresi
6. IP Adresi → Tarayıcı
DNS Kayıt Türleri
| Kayıt Türü | Açıklama | Örnek |
|---|---|---|
| A | IPv4 adresi | 192.168.1.1 |
| AAAA | IPv6 adresi | 2001:0db8:85a3::8a2e:0370:7334 |
| CNAME | Canonical Name (alias) | www → hedef.com |
| MX | Mail Exchange | mail.hedef.com |
| NS | Name Server | ns1.hedef.com |
| TXT | Metin bilgisi | SPF, DKIM, DMARC |
| SOA | Start of Authority | Yetkili DNS |
| PTR | Reverse DNS | IP → Domain |
| SRV | Service | Servis bilgisi |
DNS Sorgulama Komutları
Windows:
cmd# Temel sorgu
nslookup google.com
# Farklı DNS sunucusu ile
nslookup google.com 8.8.8.8
# Ters sorgu
nslookup 8.8.8.8
# Kayıt türü belirtme
nslookup -type=MX google.com
nslookup -type=NS google.com
nslookup -type=TXT google.com
# DNS cache temizleme
ipconfig /flushdns
Linux:
bash# Temel sorgu
dig google.com
dig google.com A
# Farklı DNS sunucusu ile
dig @8.8.8.8 google.com
# Ters sorgu
dig -x 8.8.8.8
# Kayıt türü belirtme
dig google.com MX
dig google.com NS
dig google.com TXT
# DNS cache temizleme
sudo systemd-resolve --flush-caches
DNS Security (DNSSEC)
bash# DNSSEC sorgusu
dig +dnssec google.com
# DNSSEC doğrulama
dig +sigchase google.com
DNS Pentest Komutları
bash# DNS Zone Transfer (AXFR)
dig axfr @ns1.hedef.com hedef.com
nslookup -type=any -query=AXFR hedef.com ns1.hedef.com
# Subdomain enumeration
dnsrecon -d hedef.com
dnsenum hedef.com
# DNS Brute Force
dnsrecon -d hedef.com -D subdomains.txt
🔒 Bu içeriği görmek için giriş yapın