MoinMoin Logo
  • Comments
  • Immutable Page
  • Menu
    • Navigation
    • RecentChanges
    • FindPage
    • Local Site Map
    • Help
    • HelpContents
    • HelpOnMoinWikiSyntax
    • Display
    • Attachments
    • Info
    • Raw Text
    • Print View
    • Edit
    • Load
    • Save
  • Login

Navigation

  • Start
  • Sitemap
Unknown action login.
  • dns

Contents

  1. DNS
    1. Check mail record with dig
    2. Check mail record with dig directly in name server
    3. Check reverse dns
    4. Ask for Reverse DNS for EC2 Elastic IP address
    5. Dynamic DNS Raspberry pi
    6. chucknorris host
    7. nslookup

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

  • https://portal.aws.amazon.com/gp/aws/html-forms-controller/contactus/ec2-email-limit-rdns-request

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 # ensures integrity -anti-tampering and authenticity
  11 

/etc/bind/keys.conf

secret contains the Key: value in K<...>.private file generated by dnssec-keygen command

   1 key rpi.dyn.bitarus.allowed.org. {
   2     algorithm HMAC-SHA512;
   3     secret "???????";
   4 };

/etc/bind/named.conf

   1 include "/etc/bind/keys.conf";
   2 zone "bitarus.mooo.com" IN {
   3   type master;
   4   file "/etc/bind/bitarus.mooo.com.hosts";
   5   allow-update { key "rpi.dyn.bitarus.allowed.org."; };
   6 };

/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

   1 sudo chgrp bind /etc/bind
   2 sudo chmod g+w /etc/bind
   3 sudo chown -R bind:bind /etc/bind
   4 service bind9 restart

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

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

   1 chmod 755 nsupdate-rpi.sh
   2 crontab -e
   3 */10 * * * * /home/pi/scripts/nsupdate-rpi.sh

chucknorris host

   1 named-checkconf /etc/bind/named.conf
   2 named-checkzone bitarus.mooo.com /etc/bind/bitarus.mooo.com.hosts
   3 service named restart 
   4 ping chucknorris.bitarus.mooo.com

nslookup

   1 nslookup
   2 > server x.example.org
   3 Default server: x.example.org
   4 Address: 1.2.3.4#53
   5 > set type=any
   6 > x.example.com 
   7 Server:         x.example.org
   8 Address:        1.2.3.4#53
   9 
  10 Name:   x.example.com
  11 Address: 1.2.3.4
  12 > exit
  • MoinMoin Powered
  • Python Powered
  • GPL licensed
  • Valid HTML 4.01