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
```_
``
| | 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