A Service of Softnik Technologies

A / CNAME scanner

You can get all your A / CNAME records automatically if you are able to import the data from a supported DNS provider (eg. DNS Made Easy) or if you are able to do AXFR transfers from your DNS provider. The scanner option is useful if your organization uses specific CNAME and A records and you want to identify domains that have one or more of those records.

What is it?

The CNAME / A scanner is an option available in the SED command-line tool for quickly checking all your domains for A/CNAME records corresponding to a specified list of selectors. You can specify the selectors in a text file that contains one entry per line.

The script is run from the terminal (after using SSH to connect to your server). You can also run it as a cron job at regular intervals. You don't need to run it often because it is only used to identify DNS records and is not used for actual lookups. The lookups are handled by the scheduler in Watch My Domains SED. Make sure that you run it manually at first to find the approximate time it takes to run through all your domains.

The data obtained by the scanner is automatically inserted into the domain data table as subdomains for the corresponding domain.

You can also manually enter the subdomain for each domain using the user interface.

Add Subdomains

How to use the scanner

Create a text file called subdomains.txt that contains the selectors you want to scan. These should be one entry per line. You can have entries like

www
support
mail
cpanel

Run the script from your terminal after changing to the root installation folder

php  sed.php sdscan=<path to subdomains.txt>

For example,

php  sed.php sdscan=/home/data/subdomains.txt
php  sed.php sdscan=/home/data/subdomains.txt debug

This will do the scanning and create the required table entries in the database. This will also take time because it has to do one DNS lookup for each selector in your list times the number of domains. If you are on a remote connection you may want to use the screen command before running the script. The debug option will show the progress in the terminal.

Here is a sample output

wmdsed@sed40:# php sed.php sdscan=data\subdomains.small.txt debug days=0
        Scanning.

        (2%)    1/45] softnik.com
                *** 0 www.softnik.com [CNAME] ***
                *** 0 support.softnik.com [A] ***
                *** 0 domains.softnik.com [A] ***
                *** 0 ns0.softnik.com [A] ***
                *** 0 ns1.softnik.com [A] ***
                *** 0 ns2.softnik.com [A] ***
                *** 0 ns3.softnik.com [A] ***
                *** 0 ns4.softnik.com [A] ***
                *** 0 ns10.softnik.com [A] ***
        (4%)    2/45] codepunch.com
                *** 0 www.codepunch.com [CNAME] ***
                *** 0 ns0.codepunch.com [A] ***
                *** 0 ns1.codepunch.com [A] ***
                *** 0 ns2.codepunch.com [A] ***
                *** 0 ns3.codepunch.com [A] ***
                *** 0 ns4.codepunch.com [A] ***
                *** 0 ns10.codepunch.com [A] ***
        (6%)    3/45] assetpunch.com
		...
		...

Selective Scanning

You can selectively scan only some domains using additional options.

To scan domains added within the last 6 hours, do

php  sed.php sdscan=/home/data/subdomains.txt days=0 hours=6

To scan domains added within the last 10 days, do

php  sed.php sdscan=/home/data/subdomains.txt days=10

By default, the days parameter is set to 7.

php  sed.php sdscan=/home/data/subdomains.txt

is same as

php  sed.php sdscan=/home/data/subdomains.txt days=7

To scan domains belonging to only a specified category, do

php  sed.php sdscan=/home/data/subdomains.txt domain="[IN_Business Domains]" days=0
php  sed.php sdscan=/home/data/subdomains.txt domain="[IN_Personal Domains]" days=0

To scan only a specific domain, do

php  sed.php sdscan=/home/data/subdomains.txt domain=softnik.com

To scan domains belonging to only a specified category and added within the last 6 hours, do

php  sed.php sdscan=/home/data/subdomains.txt domain="[IN_Business Domains]" days=0 hours=6