if I print the result for the whole $nsresult variable of a faulty domain, I get this on the screen:
Array ( )
When I look up the domain's nameservers via Whois and try to ping them, they will respond, so the nameservers aren't down. Is it some sort of a misconfiguration on the nameserver? Is there another way to make them respond? Thanks!
Does your script always fail on this problematic domain?
Is the problematic domain on the same server as your script (shared hosting)? In this case dns_get_record() can apparently return an empty array when attempting to get the nameservers, according to this comment on PHP.net: [php.net...]