DNS

TLD reference

  • Country Code TLDs or ccTLDs managed by the United Nations agency

Querying A Records

$ export TARGET="facebook.com"
$ nslookup $TARGET

Querying A Recrds for a subdomain

$ export TARGET=www.facebook.com
$ nslookup -query=A $TARGET
$ dig a www.facebook.com @1.1.1.1

DIG with @<nameserver/IP>

$ dig facebook.com @1.1.1.1

Querying PTR Records for an IP address

  • IP to Domain Name (Reverse DNS lookup)

$ nslookup -query=PTR 31.13.92.36
$ dig -x 31.13.92.36 @1.1.1.1

Querying ANY existing records

  • However, ANY dns request be abolished based on RFC8482 so sometimes we may not receive a response when querying ANY

$ export TARGET="google.com"
$ nslookup -query=ANY $TARGET
$ dig any google.com @8.8.8.8

Querying TXT Records

$ export TARGET="facebook.com"
$ nslookup -query=TXT $TARGET
$ dig txt facebook.com @1.1.1.1

Querying MX Records

$ export TARGET="facebook.com"
$ nslookup -query=MX $TARGET
$ dig mx facebook.com @1.1.1.1

Combining NSLookup and WHOIS

$ export TARGET="facebook.com"
$ nslookup $TARGET
$ whois 157.240.199.35

Last updated