Forum Discussion
resolve-dnsname returns odd data
hi, appreciate your time. I am working with resolve-dnsname and I am seeing some odd results. for example:
resolve-dnsname -server 10.0.20.5 -name "60.16.40.194.in-addr.arpa" -NoHostsFile -type ptr
Name Type TTL Section NameHost
---- ---- --- ------- --------
60.16.40.194.in-addr.arpa. PTR 1200 Question LNB050825-LT3
so here is what's weird about this.... when I look at my dns server with dns manager and look at the reverse zone, I do not have a record for this IP address:
Also, when I look at the resolve-dnsname data, I see there is something called "Section", and it is set to "Question". Also notice that the "NameHost" is short and not a FQDN. The "Section" is interesting because on requests the return the right data, Section is set to "Answer".
Equally weird is that if I pick a different IP that I also know does not exist, I get this:
PS C:\Trash> resolve-dnsname -server 10.0.20.5 -name "60.1.40.194.in-addr.arpa" -NoHostsFile -type ptr
Resolve-DnsName: 60.1.40.194.in-addr.arpa : DNS name does not exist.
this is what I would expect if the record does not exist....so what is happening in the first example?
Thanks in advance for anyone's time on this.
2 Replies
- Vern_AndersonCopper Contributor
On the machine where you got this output, try flushing DNS cache "ipconfig /fushdns". Then run your code again and see if you get the same results. Most likely your DNS cache just has more than one record cached and you can easily purge stale records. Your DNS Server doesn't necessarily have to have a PTR record for your DNS Client to build its own PTR in cache.
- TguadagnoCopper Contributor
Sorry, I forgot to state this initially...i am using the "NoHostsFile -dnsonly" switches...so there should be no caching involved (and no hostfile either)