Size: 413
Comment:
|
← Revision 9 as of 2025-01-13 18:48:34 ⇥
Size: 2514
Comment:
|
Deletions are marked like this. | Additions are marked like this. |
Line 5: | Line 5: |
= 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 10: |
= 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 15: |
= Check reverse dns = * dig -x 54.68.9.58 |
== Check reverse dns == {{{#!highlight sh dig -x 54.68.9.58 }}} |
Line 14: | Line 20: |
= Ask for Reverse DNS for EC2 Elastic IP address= | == Ask for Reverse DNS for EC2 Elastic IP address == |
Line 16: | Line 22: |
== Dynamic DNS Raspberry pi == {{{#!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. # secret contains the Key: value # vim /etc/bind/keys.conf key rpi.dyn.bitarus.allowed.org. { algorithm HMAC-SHA512; secret "???????"; }; # vim /etc/bind/named.conf 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."; }; }; #vim /etc/bind/bitarus.mooo.com.hosts $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. $ORIGIN bitarus.mooo.com. labs A 54.68.9.58 sudo chgrp bind /etc/bind sudo chmod g+w /etc/bind sudo chown -R bind:bind /etc/bind service bind9 restart # In raspberry pi cd /tmp scp user@bitarus.allowed.org:/tmp/K*dyn* . mkdir ~/rpiDdns mv Kr* ~/rpiDdns/ cd ~/rpiDdns/ chmod 0400 Krp* sudo apt update #vim nsupdate-rpi.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 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 }}} |
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
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
9 # secret contains the Key: value
10 # vim /etc/bind/keys.conf
11 key rpi.dyn.bitarus.allowed.org. {
12 algorithm HMAC-SHA512;
13 secret "???????";
14 };
15
16 # vim /etc/bind/named.conf
17 include "/etc/bind/keys.conf";
18 zone "bitarus.mooo.com" IN {
19 type master;
20 file "/etc/bind/bitarus.mooo.com.hosts";
21 allow-update { key "rpi.dyn.bitarus.allowed.org."; };
22 };
23
24 #vim /etc/bind/bitarus.mooo.com.hosts
25 $ORIGIN .
26 $TTL 604800 ; 1 week
27 bitarus.mooo.com IN SOA bitarus.mooo.com. root.bitarus.mooo.com. (
28 6 ; serial
29 604800 ; refresh (1 week)
30 86400 ; retry (1 day)
31 2419200 ; expire (4 weeks)
32 604800 ; minimum (1 week)
33 )
34 NS bitarus.mooo.com.
35 A 54.68.9.58
36 MX 5 mail.bitarus.mooo.com.
37 $ORIGIN bitarus.mooo.com.
38 labs A 54.68.9.58
39
40 sudo chgrp bind /etc/bind
41 sudo chmod g+w /etc/bind
42 sudo chown -R bind:bind /etc/bind
43 service bind9 restart
44
45 # In raspberry pi
46 cd /tmp
47 scp user@bitarus.allowed.org:/tmp/K*dyn* .
48 mkdir ~/rpiDdns
49 mv Kr* ~/rpiDdns/
50 cd ~/rpiDdns/
51 chmod 0400 Krp*
52 sudo apt update
53
54 #vim nsupdate-rpi.sh
55 logger "Running nsupdate-rpi.sh"
56 EXT_IP=$(wget -qO- http://ifconfig.co/ip)
57 KEY="/home/pi/rpiDdns/Krpi.dyn.bitarus.allowed.org.+165+55648.private"
58 echo "Key: $KEY"
59
60 cat <<EOF | nsupdate -k "$KEY"
61 server bitarus.allowed.org
62 zone bitarus.mooo.com
63 update delete rpi.bitarus.mooo.com. A
64 update add rpi.bitarus.mooo.com. 600 A $EXT_IP
65 show
66 send
67 EOF
68
69 chmod 755 nsupdate-rpi.sh
70 crontab -e
71 */10 * * * * /home/pi/scripts/nsupdate-rpi.sh