Removes a DNS A record and its matching PTR record together as a single, validated operation — the natural cleanup companion to Invoke-ADDnsHealthCheck. Reads both records first, confirms they reference the same host/IP, then removes the pair only when -Apply is supplied.
Most ad-hoc one-liners delete only one side of a DNS record — which is exactly how forward and reverse zones drift out of sync and turn into the orphans your DNS audit flags. Remove-DnsRecordPair finds the A record by hostname, finds the matching PTR by IP, validates the pair before any change, then removes both sides atomically with full logging. -WhatIf and -Confirm are honoured, and an audit-mode default means nothing happens until you ask for it.
Opens github.com/rt109048/Remove-DnsRecordPair in a new tab
PROVIDED AS IS. Free, open-source utility intended for experienced administrators. Always test in a non-production lab environment before running anywhere that matters. By downloading and running this script you accept full responsibility for the outcome — the author accepts no liability for any direct or indirect damage caused by use, misuse, or modification.
Copyright © 2026 ITC Technology
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the “Software”), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
Open to advisory, contract and permanent opportunities involving Active Directory, Entra ID, identity governance, or zero-trust programmes. The best way to reach me is by email.