I want to verify in my application if given domain has proper DNS records, without having to wait for a new configuration to propagate. I want to lookup the domain at the primary nameserver to obtain the freshest results, but I've found that simple SOA lookups can fail for subdomains.
> resolveSoa('subdomain.example.com')
Error: ENOTFOUND
Also mode of failure for subdomains with defined CNAME is different (that probably depends on the dns server software):
> resolveSoa('cnamed-subdomain.example.com')
Error: EBADRESP
What is the proper way of fiding the primary nameserver for any (valid) domain?