Question

I am using dig installed on my machine to search for SPF records for a particular domain. Is there a way to search a particular DNS server for the SPF records?

For example, will the following work?

dig domain.com txt host ns1.nameserver1.com

dig domain.com txt host ns2.nameserver2.com
Was it helpful?

Solution

I believe that I found the correct answer through this dig How To. I was able to look up the SPF records on a specific DNS, by using the following query:

dig @ns1.nameserver1.com domain.com txt

OTHER TIPS

The dig utility is pretty convenient to use. The order of the arguments don't really matter.I'll show you some easy examples.
To get all root name servers use

# dig

To get a TXT record of a specific host use

# dig example.com txt
# dig host.example.com txt

To query a specific name server just add @nameserver.tld

# dig host.example.com txt @a.iana-servers.net

The SPF RFC4408 says that SPF records can be stored as SPF or TXT. However nearly all use only TXT records at the moment. So you are pretty safe if you only fetch TXT records.

I made a SPF checker for visualising the SPF records of a domain. It might help you to understand SPF records better. You can find it here: http://spf.myisp.ch

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top