DNS Lookup - Get domain information quickly

Опубликовано: 30 Сентябрь 2024
на канале: Linux Milestone
52
2

To find information about any domain, create a .sh file using below script. Copy it as it is excluding the top and bottom lines.
............................................................................................................
#!/bin/bash

read -p "Enter Domain Name : " my_var
echo "MX Records" ---------------------------------------------------------------------------
dig MX ${my_var}
echo "NS Records" ---------------------------------------------------------------------------
dig NS ${my_var}
echo "CNAME Records" ---------------------------------------------------------------------------
dig CNAME ${my_var}
echo "DMARC Records" ---------------------------------------------------------------------------
dig _dmarc.${my_var} txt
echo "DKIM Records" ---------------------------------------------------------------------------
dig selector1._domainkey.${my_var} txt
dig selector2._domainkey.${my_var} txt
echo "Domain Regristration Information" ---------------------------------------------------------------------------
whois ${my_var} | grep -E 'Registrar|Expiration|Country|State|City|Postal|Phone|Email'

.................................................................................................................................