Linux/DNS

From Wiki
< Linux
Revision as of 09:30, 8 April 2019 by Marcluer (talk | contribs)

host (scripting)

nslookup

dig (testing)

  • install
apt install dnsutils
  • Basic query
dig google.com
  • Query all record types
dig google.com ANY
  • Query specific DNS server
dig google.de @8.8.8.8
  • Reverse DNS lookup
dig -x 193.99.144.80
  • Trace DNS path
dig google.com +trace

DNS entry

$TTL 86400
@ IN SOA ns1.first-ns.de. postmaster.robot.first-ns.de. (
     2000091604  ; Serial
     14400       ; Refresh
     1800        ; Retry
     604800      ; Expire
     86400  )    ; Minimum

@           IN NS    ns1.first-ns.de.
@           IN NS    robotns2.second-ns.de.
@           IN NS    robotns3.second-ns.com.

localhost   IN A     127.0.0.1
@           IN A     1.2.3.4
www         IN A     2.3.4.5
www         IN AAAA  2001:db8::1
mail        IN A     2.3.4.5

loopback    IN CNAME localhost
pop         IN CNAME www
smtp        IN CNAME www
relay       IN CNAME www
imap        IN CNAME www
ftp    3600 IN CNAME ftp.anderedomain.de.

@           IN MX 10 mail

technik     IN A     5.6.7.8
technik     IN MX 10 technik

@           IN TXT   "v=spf1 mx -all"

DNS entry types

  • A (Host address)
  • AAAA (IPv6 host address)
  • ALIAS (Auto resolved alias)
  • CNAME (Canonical name for an alias)
  • MX (Mail eXchange)
  • NS (Name Server)
  • PTR (Pointer)
  • SOA (Start Of Authority)
$TTL 86400
@ IN SOA ns1.first-ns.de. postmaster.robot.first-ns.de. (
2000091604  ; Serial
14400       ; Refresh
1800        ; Retry
604800      ; Expire
86400  )    ; Minimum
  • SRV (location of service)
  • TXT (Descriptive text)