Shell Script to Dump all Domain Zone Records?

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • beporter
    New Member
    • Nov 2006
    • 15

    Shell Script to Dump all Domain Zone Records?

    I've been searching the internet for some kind of script that will utilize dig or similar to dump ALL A, CNAME, MX, TXT, etc. records for a given domain. Is there any way to retrieve all of the records and IP addresses without knowing the actual subdomains to query? For example, if I just know "mydomain.c om" is there any way to find the A and MX records (and the IPs they point to) for mail.mydomain.c om programatically ?

    My goal is to automate a backup of all the records for a domain before performing a registrar transfer so I can recreate the records identically afterwards.

    Does anyone know of an existing tool (or could provide a bit of guidance for a new shell script) that can manage this?

    Thanks in advance!
  • beporter
    New Member
    • Nov 2006
    • 15

    #2
    What I'm looking to avoid is having to manually log into the registrar's website and write everything down by hand.

    Comment

    • ValHolla
      New Member
      • Sep 2006
      • 8

      #3
      Originally posted by beporter
      What I'm looking to avoid is having to manually log into the registrar's website and write everything down by hand.

      using the nslookup command (windows or UNIX) you can get this information.
      here is a quick sample script for UNIX (nslookup-dmp.ksh)
      usage will be nslookup-dmp.ksh {domain} i.e. yourname.com
      Code:
      #!/bin/ksh
      /bin/echo "The Internet Address of $1..."
      /bin/nslookup -q=A $1
      /bin/echo "The canonical name for alias for $1..."
      /bin/nslookup -q=CNAME $1
      /bin/echo "The host CPU and OS Type..."
      /bin/nslookup -q=HINFO $1
      /bin/echo "The Mail Exchanger for $1..."
      /bin/nslookup -q=MX $1
      /bin/echo "The Statement of Authority for $1..."
      /bin/nslookup -q=SOA $1
      /bin/echo "The text information for $1..."
      /bin/nslookup -q=TXT $1
      /bin/echo "The Well Known Services for $1..."
      /bin/nslookup -q=WKS $1

      Comment

      Working...