Tag: #DNS

  • How to Backup DNS Server 2022

    How to Backup DNS Server 2022

    In this article, I will explain how to backup DNS Windows Server 2022. Domain Name System/Server or DNS is the heart of each thing we do, on the internet and on the LAN. It is the directory book that changes names to IP addresses so we don’t have to remember the figures that represent websites, hostnames, and other resources. DNS is commonly considered an important infrastructure component.

    When a disaster happened with a DNS Server, we need to restore the DNS zone to its earlier state as soon as possible. In this article, we have two options for achieving this operation. The initial option in AD DS is authoritative restore. A reliable restore of an Active Directory would take complex time-consuming and also demands the use of backups and restart of DCs. The 2nd one is to use the DNSCMD.exe using the PowerShell command to backup the zones to a text file, which is Obtainable for Windows Servers. The DNSCMD restore takes some minutes to restore a zone. We can apply to both (forward, reverse) lookup zones, either text-based or Active Directory-integrated.

    Backup DNS Windows Server 2022

    Article Scenario

    Backup DNS zones via DNSCMD PowerShell command.

    2nd, we will delete xpertstec.local DNS zones from a server for creating the disaster.

    Last, we restore xpertstec.local zone from a file the one we created with the DNSCMD command.

    How to take a DNS backup (xpertstec.

    Log in to the Domain Controller, run Windows PowerShell and then type the following commands to backup DNS zones.

    dnscmd WS2022-DC /ZoneExport xpertstec.local backup\xpertstec.local.dns.bkp

    dnscmd WS2022-DC /ZoneExport _msdcs.xpertstec.local backup_msdcs.xpertstec.local.dns.bkp

    Where WS2022-DC is the DNS server name.

    Backup DNS PowerShell

    The DNS backup copy (a text file) will be saved to the backup directory.

    C:\Windows\System32\dns\backup

    Launch Windows Explorer and then go to the C:\Windows\System32\dns\backup directory to verify its contents.

    C:\Windows\System32\dnsbackup

    How to Delete DNS zones from DNS manager

    Launch DNS Manager, expand the DNS server (WS2022-DC) node and then expand Forward Lookup Zones.

    Right-click on xpertstec.local zone and then select delete.

    DNS Manager

    Click Yes

    Delete the DNS zone warning

    And Yes again delete the zone from (Active Directory and DNS Server).

    Remove the DNS zone warning

    How to Restore the domain DNS zone

    Open DNS Manager, and expand the DNS Server.

    Right click on Forward Lookup Zone and then click on New Zone.

    DNS Manager create new zone

    Welcome to the New Zone Wizard, click Next.

    Welcome to the new zone wizard

    Zone Type window, choose Primary zone and then deselect the Store the zone in Active Directory, click next.

    New zone wizard primary zone

    Zone Name window, enter the name of the zone being restored, xpertstec.local and then click next.

    Backup DNS wizard zone name

    Choose the option Use this existing file radio button and then click Next.

    Backup DNS wizard zone file

    Please make sure the current backup of the xpertstec.

    Copy the xpertstec.local.dns.bkp file to the backup directory.

    Backup DNS directory Windows Server

    Paste it into the following directory
    C:\Windows\System32\dns

    Backup DNS directory Windows Server

    Right-click on xpertstec.local.dns.bkp and then select rename.

    Rename Backup DNS

    Remove the .bkp extension, press enter, and click yes.

    Backup DNS directory

    Go back to the Zone File Wizard, and then click Next.

    Restore DNS wizard zone file

    Dynamic Update wizard window, choose to Allow both nonsecure and secure dynamic updates, and then click next.

    Restore DNS wizard dynamic update

    Click finish

    Completing the new zone wizard

    Forward lookup zone (xpertstec.local) has been created successfully.
    Right Click on xpertstec.local zone and then select Properties.

    DNS manager

    Click on the Change… button next to the Primary field.

    Backup DNS dynamic update

    Change the Zone Type window, make sure the Primary zone is selected
    Select the option Store the zone in Active Directory and then click ok.

    Change zone type DNS

    Click Yes to accept the change.

    dns active directory integrated

    On the xpertstec.local zone Properties window, choose Secure only at Dynamic updates field and click ok.

    Local DNS server properties

    Finally, we have our DNS Zone up and running.

    Summary:

    By using the above steps, you can backup, and restore, the copies of the DNS zones in a way that allows high availability for your DNS

    For more details please visit Microsoft

    Read more: How to Backup, Restore, and Reset Windows Server.