|
Size: 414
Comment:
|
Size: 3293
Comment:
|
| Deletions are marked like this. | Additions are marked like this. |
| Line 1: | Line 1: |
| = dns = | <<TableOfContents(2)>> = DNS = |
| Line 5: | Line 7: |
| = Check mail record with dig = * dig mx bitarus.allowed.org |
== Check mail record with dig == {{{#!highlight sh dig mx bitarus.allowed.org }}} |
| Line 8: | Line 12: |
| = Check mail record with dig directly in name server = * dig mx bitarus.allowed.org @ns.bitarus.allowed.org |
== Check mail record with dig directly in name server == {{{#!highlight sh dig mx bitarus.allowed.org @ns.bitarus.allowed.org }}} |
| Line 11: | Line 17: |
| = Check reverse dns = * dig -x 54.68.9.58 |
== Check reverse dns == {{{#!highlight sh dig -x 54.68.9.58 }}} |
| Line 14: | Line 22: |
| = Ask for Reverse DNS for EC2 Elastic IP address = | == Ask for Reverse DNS for EC2 Elastic IP address == |
| Line 16: | Line 24: |
== Dynamic DNS Raspberry pi == === In bind9 server === {{{#!highlight sh # change apparmor in ubuntu apt install apparmor-utils sudo aa-complain /usr/sbin/named service bind9 restart cd /tmp # bind server dnssec-keygen -a HMAC-SHA512 -b 512 -n USER rpi.dyn.bitarus.allowed.org. # generates 2 files, one with extension .key and another with extension .private with the same symmetric key # it generates a symmetric key }}} === /etc/bind/keys.conf === secret contains the Key: value in K<...>.private file generated by dnssec-keygen command {{{#!highlight sh key rpi.dyn.bitarus.allowed.org. { algorithm HMAC-SHA512; secret "???????"; }; }}} === /etc/bind/named.conf === {{{#!highlight sh include "/etc/bind/keys.conf"; zone "bitarus.mooo.com" IN { type master; file "/etc/bind/bitarus.mooo.com.hosts"; allow-update { key "rpi.dyn.bitarus.allowed.org."; }; }; }}} === /etc/bind/bitarus.mooo.com.hosts === Subdomain bitarus.mooo.com {{{#!highlight sh $ORIGIN . $TTL 604800 ; 1 week bitarus.mooo.com IN SOA bitarus.mooo.com. root.bitarus.mooo.com. ( 6 ; serial 604800 ; refresh (1 week) 86400 ; retry (1 day) 2419200 ; expire (4 weeks) 604800 ; minimum (1 week) ) NS bitarus.mooo.com. A 54.68.9.58 MX 5 mail.bitarus.mooo.com. TXT "keyx=valuex" $ORIGIN bitarus.mooo.com. labs A 54.68.9.58 }}} {{{#!highlight sh sudo chgrp bind /etc/bind sudo chmod g+w /etc/bind sudo chown -R bind:bind /etc/bind service bind9 restart }}} === In raspberry pi === {{{#!highlight sh cd /tmp scp user@bitarus.allowed.org:/tmp/K*dyn* . mkdir ~/rpiDdns mv Kr* ~/rpiDdns/ cd ~/rpiDdns/ chmod 0400 Krp* sudo apt update }}} === nsupdate-rpi.sh === {{{#!highlight sh logger "Running nsupdate-rpi.sh" EXT_IP=$(wget -qO- http://ifconfig.co/ip) KEY="/home/pi/rpiDdns/Krpi.dyn.bitarus.allowed.org.+165+55648.private" echo "Key: $KEY" cat <<EOF | nsupdate -k "$KEY" server bitarus.allowed.org zone bitarus.mooo.com update delete rpi.bitarus.mooo.com. A update add rpi.bitarus.mooo.com. 600 A $EXT_IP show send EOF }}} === Steps === {{{#!highlight sh chmod 755 nsupdate-rpi.sh crontab -e */10 * * * * /home/pi/scripts/nsupdate-rpi.sh }}} == chucknorris host == {{{#!highlight sh named-checkconf /etc/bind/named.conf named-checkzone bitarus.mooo.com /etc/bind/bitarus.mooo.com.hosts service named restart ping chucknorris.bitarus.mooo.com }}} == nslookup == {{{#!highlight sh nslookup > server x.example.org Default server: x.example.org Address: 1.2.3.4#53 > set type=any > x.example.com Server: x.example.org Address: 1.2.3.4#53 Name: x.example.com Address: 1.2.3.4 > exit }}} |
Contents
DNS
Domain name service
Check mail record with dig
1 dig mx bitarus.allowed.org
Check mail record with dig directly in name server
1 dig mx bitarus.allowed.org @ns.bitarus.allowed.org
Check reverse dns
1 dig -x 54.68.9.58
Ask for Reverse DNS for EC2 Elastic IP address
Dynamic DNS Raspberry pi
In bind9 server
1 # change apparmor in ubuntu
2 apt install apparmor-utils
3 sudo aa-complain /usr/sbin/named
4 service bind9 restart
5
6 cd /tmp # bind server
7 dnssec-keygen -a HMAC-SHA512 -b 512 -n USER rpi.dyn.bitarus.allowed.org.
8 # generates 2 files, one with extension .key and another with extension .private with the same symmetric key
9 # it generates a symmetric key
10
/etc/bind/keys.conf
secret contains the Key: value in K<...>.private file generated by dnssec-keygen command
/etc/bind/named.conf
/etc/bind/bitarus.mooo.com.hosts
Subdomain bitarus.mooo.com
1 $ORIGIN .
2 $TTL 604800 ; 1 week
3 bitarus.mooo.com IN SOA bitarus.mooo.com. root.bitarus.mooo.com. (
4 6 ; serial
5 604800 ; refresh (1 week)
6 86400 ; retry (1 day)
7 2419200 ; expire (4 weeks)
8 604800 ; minimum (1 week)
9 )
10 NS bitarus.mooo.com.
11 A 54.68.9.58
12 MX 5 mail.bitarus.mooo.com.
13 TXT "keyx=valuex"
14 $ORIGIN bitarus.mooo.com.
15 labs A 54.68.9.58
In raspberry pi
nsupdate-rpi.sh
1 logger "Running nsupdate-rpi.sh"
2 EXT_IP=$(wget -qO- http://ifconfig.co/ip)
3 KEY="/home/pi/rpiDdns/Krpi.dyn.bitarus.allowed.org.+165+55648.private"
4 echo "Key: $KEY"
5
6 cat <<EOF | nsupdate -k "$KEY"
7 server bitarus.allowed.org
8 zone bitarus.mooo.com
9 update delete rpi.bitarus.mooo.com. A
10 update add rpi.bitarus.mooo.com. 600 A $EXT_IP
11 show
12 send
13 EOF
Steps
chucknorris host
