|
Size: 2514
Comment:
|
Size: 3028
Comment:
|
| Deletions are marked like this. | Additions are marked like this. |
| Line 1: | Line 1: |
| = dns = | <<TableOfContents(2)>> = DNS = |
| Line 24: | Line 26: |
=== In bind9 server === |
|
| Line 32: | Line 36: |
| # secret contains the Key: value }}} |
|
| Line 33: | Line 39: |
| # secret contains the Key: value # vim /etc/bind/keys.conf |
=== /etc/bind/keys.conf === {{{#!highlight sh |
| Line 39: | Line 45: |
| }}} | |
| Line 40: | Line 47: |
| # vim /etc/bind/named.conf | === /etc/bind/named.conf === {{{#!highlight sh |
| Line 47: | Line 55: |
| }}} | |
| Line 48: | Line 57: |
| #vim /etc/bind/bitarus.mooo.com.hosts | === /etc/bind/bitarus.mooo.com.hosts === Subdomain bitarus.mooo.com {{{#!highlight sh |
| Line 61: | Line 72: |
| TXT "keyx=valuex" | |
| Line 63: | Line 75: |
| }}} | |
| Line 64: | Line 77: |
| {{{#!highlight sh | |
| Line 68: | Line 82: |
| }}} | |
| Line 69: | Line 84: |
| # In raspberry pi | === In raspberry pi === {{{#!highlight sh |
| Line 105: | Line 121: |
== 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
/etc/bind/keys.conf
/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
1 cd /tmp
2 scp user@bitarus.allowed.org:/tmp/K*dyn* .
3 mkdir ~/rpiDdns
4 mv Kr* ~/rpiDdns/
5 cd ~/rpiDdns/
6 chmod 0400 Krp*
7 sudo apt update
8
9 #vim nsupdate-rpi.sh
10 logger "Running nsupdate-rpi.sh"
11 EXT_IP=$(wget -qO- http://ifconfig.co/ip)
12 KEY="/home/pi/rpiDdns/Krpi.dyn.bitarus.allowed.org.+165+55648.private"
13 echo "Key: $KEY"
14
15 cat <<EOF | nsupdate -k "$KEY"
16 server bitarus.allowed.org
17 zone bitarus.mooo.com
18 update delete rpi.bitarus.mooo.com. A
19 update add rpi.bitarus.mooo.com. 600 A $EXT_IP
20 show
21 send
22 EOF
23
24 chmod 755 nsupdate-rpi.sh
25 crontab -e
26 */10 * * * * /home/pi/scripts/nsupdate-rpi.sh
chucknorris host
