resolve-dnsname and PTR/reverse zones

Welcome Forums General PowerShell Q&A resolve-dnsname and PTR/reverse zones

Viewing 3 reply threads
  • Author
    Posts
    • #179379
      Participant
      Topics: 28
      Replies: 59
      Points: 154
      Rank: Participant

      the documentation sure says PTR is a valid option for -Type, but I can't figure out how to query a reverse zone for ptr records.

      resolve-dnsname 10.10.10.in-addr.arpa -Server MyDNSServer -type any

      returns NS, SOA and A records for that 10.10.10.0 reverse zone, but no PTR records (yes, there are PTR records in the zone). so obviously

      resolve-dnsname 10.10.10.in-addr.arpa -Server MyDNSServer -type ptr

      returns nothing.

      anybody know what i'm doing wrong?

    • #179385
      Participant
      Topics: 0
      Replies: 115
      Points: 433
      Helping Hand
      Rank: Contributor

      Hey John,

      You will need to specify the IP address of the record you are trying to complete a reverse look up i.e. below.

      Resolve-DnsName -Server dns.google.com -Name 8.8.8.8 -Type ptr | FL
      
      Name : 8.8.8.8.in-addr.arpa
      Type : PTR
      TTL : 21073
      Section : Answer
      NameHost : dns.google

       

       

    • #179388
      Participant
      Topics: 28
      Replies: 59
      Points: 154
      Rank: Participant

      i figured it out.  i'm trying to query for all PTR records in a reverse zone. like the nslookup command

      ls -d 10.10.10.in-addr.arpa

      but resolve-dns name is for querying for an individual address. so when i point it at 10.10.10.in-addr.arpa , i'm only getting the records for that zone itself, not the records it contains.

      this does what i want:

      get-dnsserverresourcerecord 10.10.10.in-addr.arpa -computername myDNSserver -rrtype ptr

    • #179394
      Participant
      Topics: 0
      Replies: 115
      Points: 433
      Helping Hand
      Rank: Contributor

      John,

      Yes, that is correct, essentially you are tyring to complete an entire Dig of a ReverseLookup zone. That is out of the scope of Resolve-DNSName. Glad you were able to figure it out quickly! Let us know if you have any other questions.

       

       

Viewing 3 reply threads
  • The topic ‘resolve-dnsname and PTR/reverse zones’ is closed to new replies.