Advertisement
Guest User

DNS: Check server A record against public facing IP

a guest
Sep 3rd, 2014
258
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 0.37 KB | None | 0 0
  1. #!/bin/bash
  2.  
  3. # checks ip of darkglass.net server in DNS versus via public call
  4. # probably don't have to note that this could easily become a problem.
  5.  
  6. DNSADDRESS=$(dig @ns1mpz.name.com darkglass.net A +short)
  7. PUBLICIP=$(wget http://ipecho.net/plain -O - -q ; echo)
  8.  
  9. if [ "$DNSADDRESS" == "$PUBLICIP" ]; then
  10.     echo "DGS OK!"
  11. else
  12.     echo "DGS IP mismatch!"
  13. fi
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement