Nslookup - DNS Lookup und Fehlerbehebung¶
``
``
Alle Befehle, die in die Zwischenablage kopiert werden!
Überblick¶
nslookup ist ein Befehlszeilentool für die Netzwerkverwaltung, um das Domain Name System (DNS) abzufragen, um Domainnamen oder IP-Adressen-Mapping oder andere DNS-Datensätze zu erhalten. Es ist auf den meisten Betriebssystemen verfügbar und ist für DNS-Fehlersuche und Netzwerkdiagnose unerlässlich.
Grundprinzip¶
```bash
Non-interactive mode¶
nslookup [options] [name] [server]
Interactive mode¶
nslookup nslookup - nslookup - [server] ```_
Wesentliche Befehle¶
Grundlegende DNS Lookups¶
```bash
# Look up A record (IPv4 address)
nslookup google.com
```_
``
```bash
# Look up using specific DNS server
nslookup google.com 8.8.8.8
```_
``
```bash
# Reverse DNS lookup (IP to domain)
nslookup 8.8.8.8
```_
``
Abfragen von Datenträgern¶
```bash
# A record (IPv4 address)
nslookup -type=A google.com
```_
``
```bash
# AAAA record (IPv6 address)
nslookup -type=AAAA google.com
```_
``
```bash
# MX record (Mail Exchange)
nslookup -type=MX google.com
```_
``
```bash
# NS record (Name Server)
nslookup -type=NS google.com
```_
``
```bash
# TXT record (Text records)
nslookup -type=TXT google.com
```_
``
```bash
# CNAME record (Canonical Name)
nslookup -type=CNAME www.google.com
```_
``
```bash
# SOA record (Start of Authority)
nslookup -type=SOA google.com
```_
``
```bash
# PTR record (Pointer for reverse lookup)
nslookup -type=PTR 8.8.8.8
```_
``
```bash
# ANY record (All available records)
nslookup -type=ANY google.com
```_
``
```bash
# SRV record (Service record)
nslookup -type=SRV _sip._tcp.example.com
```_
``
Interaktiver Modus¶
Interaktiv starten Modus¶
```bash
# Enter interactive mode
nslookup
```_
``
```bash
# Enter interactive mode with specific server
nslookup - 8.8.8.8
```_
``
Befehle des interaktiven Modus¶
```bash
# Change DNS server
server 8.8.8.8
```_
``
```bash
# Set query type to MX
set type=MX
```_
``
```bash
# Set query type to NS
set type=NS
```_
``
```bash
# Enable debug mode
set debug
```_
``
```bash
# Disable debug mode
set nodebug
```_
``
```bash
# Show all current settings
set all
```_
``
```bash
# Exit interactive mode
exit
```_
``
Erweiterte Optionen¶
Debug und Fehlerbehebung¶
```bash
# Enable debug output
nslookup -debug google.com
```_
``
```bash
# Specify custom port
nslookup -port=53 google.com
```_
``
```bash
# Set timeout (seconds)
nslookup -timeout=10 google.com
```_
``
```bash
# Set retry attempts
nslookup -retry=3 google.com
```_
``
```bash
# Use recursive query
nslookup -recurse google.com
```_
``
```bash
# Disable recursive query
nslookup -norecurse google.com
```_
``
```bash
# Use TCP instead of UDP
nslookup -vc google.com
```_
``
Beliebte DNS Server¶
```bash
# Google DNS
nslookup google.com 8.8.8.8
```_
``
```bash
# Cloudflare DNS
nslookup google.com 1.1.1.1
```_
``
```bash
# OpenDNS
nslookup google.com 208.67.222.222
```_
``
```bash
# Quad9 DNS
nslookup google.com 9.9.9.9
```_
``
Allgemeine Anwendungsfälle¶
Email Server Fehlerbehebung¶
```bash
# Check MX records for email routing
nslookup -type=MX example.com
```_
``
```bash
# Verify mail server IP
nslookup mail.example.com
```_
``
Domain Verifikation¶
```bash
# Check domain ownership via TXT records
nslookup -type=TXT example.com
```_
``
```bash
# Verify SPF records
nslookup -type=TXT example.com|grep "v=spf1"
```_
``
Netzwerkdiagnose¶
```bash
# Check authoritative name servers
nslookup -type=NS example.com
```_
``
```bash
# Verify reverse DNS
nslookup 192.168.1.1
```_
``
```bash
# Check domain authority info
nslookup -type=SOA example.com
```_
``
Batch Operationen¶
Mehrere Abfragen¶
```bash
# Query multiple domains from file
nslookup -type=A ``< domains.txt
```_
```bash
# Pipe domain to nslookup
echo "google.com"|nslookup
```_
``
Fehlermeldungen¶
Error | Meaning |
---|---|
** server can't find domain: NXDOMAIN |
Domain doesn't exist |
** server can't find domain: SERVFAIL |
DNS server failure |
** server can't find domain: REFUSED |
Query refused by server |
** Request timed out |
No response from DNS server |
** No response from server |
DNS server unreachable |
Installation¶
Linux (Ubuntu/Debian)¶
bash
sudo apt-get install dnsutils
_
Linux (CentOS/RHEL/Fedora)¶
```bash sudo yum install bind-utils
or¶
sudo dnf install bind-utils ```_
Windows¶
nslookup kommt mit Windows vorinstalliert.
macOS¶
nslookup kommt mit macOS vorinstalliert.
Tipps und Best Practices¶
- ** Verwenden Sie spezifische DNS-Server** zum Testen, um Cache-Ergebnisse zu vermeiden
- ** Debug-Modus aktivieren*, wenn komplexe Probleme behoben werden
- ** Prüfen Sie mehrere Rekordtypen** für umfassende Domänenanalyse
- ** Verwenden Sie umgekehrte Lookups*, um IP-Adresse Eigentümer zu überprüfen
- Kompare Ergebnisse von verschiedenen DNS-Servern zur Identifizierung von Inkonsistenzen
- Interactive mode ist für mehrere Abfragen auf demselben Server nützlich
- ** Kombinieren Sie mit anderen Tools* wie Graben und Host für vollständige DNS-Analyse
Weitere Befehle¶
dig
- Detailliertes DNS Lookup Toolhost
- Einfaches DNS-Lookup-Dienstprogrammping
_ Testnetzwerkkonnektivitättraceroute
whois
- Domain-Registrierungsinformationen