Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

win_dns_zone : Add Reverse Lookup zone possibility #519

Open
divxdigit opened this issue Jun 6, 2023 · 1 comment
Open

win_dns_zone : Add Reverse Lookup zone possibility #519

divxdigit opened this issue Jun 6, 2023 · 1 comment

Comments

@divxdigit
Copy link

SUMMARY

Currently the module only allows "Forward Lookup Zones".
It would be usefull to allow "Reverse Lookup zones" to the module. This can be done with the parameter NetworkID and optionally the ZoneFile parameter.
The add-on would fit perfectly in this current module because it uses the same powershell module to configure it.

ISSUE TYPE
  • Feature Idea
COMPONENT NAME

win_dns_zone

ADDITIONAL INFORMATION
$spec = @{
    options = @{
        name = @{ type = "str"; required = $true }
        type = @{ type = "str"; choices = "primary", "secondary", "forwarder", "stub" }
        replication = @{ type = "str"; choices = "forest", "domain", "legacy", "none" }
        dynamic_update = @{ type = "str"; choices = "secure", "none", "nonsecureandsecure" }
        state = @{ type = "str"; choices = "absent", "present"; default = "present" }
        forwarder_timeout = @{ type = "int" }
        dns_servers = @{ type = "list"; elements = "str" }
        network_id = @{ type = "str" }
        zone_file = @{ type = "str" }
    }
...
$network_id = $module.Params.network_id
$replication = $module.Params.replication
$zone_file = $module.Params.zone_file
...

#To create  a reverse lookup zone 
if ($replication -and $network_id) # variable values need to exist to be parsed
{
  if ($zone_file -like "*in-addr.arpa.dns") 
  {
    #----- Example: Create a file-backed reverse lookup zone -----
    #    This command creates the file-backed reverse lookup zone 0.3.10.in-addr.arpa.
    #PS C:\> Add-DnsServerPrimaryZone -NetworkID 10.3.0.0/24 -ZoneFile "0.3.10.in-addr.arpa.dns"
    Add-DnsServerPrimaryZone -NetworkID $network_id -ReplicationScope $replication -ZoneFile $zone_file
  }
  else
  {
    # ----------- Example 3: Create a reverse lookup zone -----------
    #    This command creates the Active Directory-integrated class C reverse lookup zone 0.1.10.in-addr.arpa with Forest-wide replication scope.
    #  PS C:\> Add-DnsServerPrimaryZone -NetworkID "10.1.0.0/24" -ReplicationScope "Forest"
    #   ZoneName                            ZoneType        IsAutoCreated   IsDsIntegrated  IsReverseLookupZone  IsSigned
    #    --------                            --------        -------------   --------------  -------------------  --------
    #   1.10.in-addr.arpa                   Primary         False           True            True                 False

    Add-DnsServerPrimaryZone -NetworkID $network_id -ReplicationScope $replication
  }
}
else 
{
...
}

#
@jpylypiw
Copy link

I would like to join the feature. We only have a few forward zones in the Active Directory DNS and significantly more reverse zones. We currently have to make a workaround via PowerShell to create the reverse lookup zones.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants