DNS with a large number of subzones

This topic contains 1 reply, has 2 voices, and was last updated by  postanote 3 weeks, 3 days ago.

  • Author
    Posts
  • #99949

    Jeremiah Logan
    Participant

    I am working with a company that has a a number of parent and child domains in DNS. The layout is something like this:

    parent.com
    intra.parent.com
    MI.intra.parent.com
    IN.intra.parent.com
    KY.intra.parent.com
    etc...
    meet.parent.com
    meetHQ.parent.com
    etc...
    sip.parent.com
    etc...
    etc...

    I am attempting to write a script that will search through all of DNS for A records. When I attempt to list all forward lookup zones, like so:

    Get-DnsServerZone -ComputerName dnsServer01 |
        Where-Object {$_.IsReverseLookupZone -eq $false} | 
            Out-GridView
    

    I get only the top level zones (intra.parent.com, meet.parent.com, etc.). I cannot return MI.intra.parent.com, or KY.intra.parent.com. This is leaving me unable to search for the A records in all areas.

    As an alternative, I have tried searching for the records using the .Net method, like so:

    $pc = "testPC1"
    [System.Net.Dns]::GetHostByName($pc)
    

    and this returns the HostName including Zone name, CNAME and IP address(es) as I would expect. But I am unsure how then to translate this into a method of modifying or deleting the record, as even a straight call to that zone is failing for me. For example, running the code above gives me the output of "testPC1.MI.intra.parent.com", however if I run this:

    Get-DnsServerResourceRecord -ComputerName $DNSServer -ZoneName "mi.intra.parent.com" -Node "testPC1"
    

    I get the error:

    Get-DnsServerResourceRecord : The zone mi.intra.parent.com was not found on server $DNSServer.

    I tried going up a level to just intra.parent.com, but get the response:

    Get-DnsServerResourceRecord : Failed to get testPC1 record in intra.parent.com zone on DNSServer server.

    So I am looking for suggestions on either querying through all levels of dns zones, or somehow using the other DNS functions on the information returned from the .Net call that seems to be working.

  • #100015

    postanote
    Participant

    Did you see Matt's response to your previous post?

You must be logged in to reply to this topic.