Linux/DNS: Difference between revisions

From Wiki
No edit summary
No edit summary
 
(5 intermediate revisions by the same user not shown)
Line 1: Line 1:
== host ==
== Ubuntu 18.04 show DNS settings ==
 
<pre>
== nslookup ==
systemd-resolve --status
</pre>


== host (scripting) ==


== dig ==
== dig (testing) ==
* install
* install
<pre>apt install dnsutils</pre>  
<pre>apt install dnsutils</pre>  
Line 23: Line 25:
<pre>dig google.com +trace</pre>
<pre>dig google.com +trace</pre>


== entry types ==
== nslookup ==
<pre>
nslookup google.com
nslookup -query=ANY google.com
</pre>
 
== DNS entry ==
<pre>
<pre>
$TTL 86400
$TTL 86400
Line 58: Line 66:
</pre>
</pre>


== DNS entry types ==
* ANY (all types)
* A (Host address)
* A (Host address)
* AAAA (IPv6 host address)
* AAAA (IPv6 host address)

Latest revision as of 11:29, 19 August 2019

Ubuntu 18.04 show DNS settings

systemd-resolve --status

host (scripting)

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

nslookup

nslookup google.com
nslookup -query=ANY google.com

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

  • ANY (all 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)