I'm using node.js's dns.resolve function to find NS and CNAME records for a given domain. I also would like to get TXT and SPF records now. If I do that all separately - it's four requests. Is there any way to get all four record types in one request?
Also, is the SPF information always in TXT record type or it can have its own?
I'm no Nodejs expert, but just from looking, it appears you're going to have to do four different requests.
Also, is there any way to query SPF record with this function at all or should I use something else?
Well according to Wikipedia, SPF is:
Sender Policy Framework (SPF) is an email validation system designed to prevent email spam by detecting email spoofing, a common vulnerability, by verifying sender IP addresses. SPF allows administrators to specify which hosts are allowed to send mail from a given domain by creating a specific SPF record (or TXT record) in the Domain Name System (DNS). Mail exchangers use the DNS to check that mail from a given domain is being sent by a host sanctioned by that domain's administrators.
You could code your own, probably by querying the TXT record and then doing a check to see whether it is valid.
Again, I have very minimal Nodejs knowledge.