Networking Azure

Unbound on Windows Server 2025 on Azure User Guide

| Product: Unbound on Windows Server 2025

Overview

This guide covers the deployment and use of Unbound on Windows Server 2025 on Microsoft Azure, using cloudimg's virtual machine image from the Azure Marketplace.

Unbound is NLnet Labs' open source (BSD 3-Clause) DNS resolver. It resolves names recursively, starting from the DNS root, validates every signed answer with DNSSEC, and caches the results so repeat lookups are answered in microseconds. This image runs it as a private resolver for your Azure virtual network: the machines in your network send their DNS queries to it, and it answers them, while anyone on the internet is refused.

The image is Microsoft Windows Server 2025 Datacenter with the Desktop Experience (the full graphical interface), Gen2, x64, built from Microsoft's own image on the Azure Marketplace (MicrosoftWindowsServer:WindowsServer:2025-datacenter-g2, version 26100.33828.261112). The Windows Server licence is included in the VM price and billed by Microsoft.

What's included:

  • Unbound 1.26.2 for Windows (64-bit), NLnet Labs' own Windows build, unmodified, its checksum and its signature (NLnet Labs releases signing key G2) verified when the image was built, in C:\Program Files\Unbound\
  • Unbound running as the Windows service unbound ("Unbound DNS validator") under its own virtual service account NT SERVICE\unbound, never LocalSystem: started at boot and restarted if it ever stops
  • DNS on port 53, UDP and TCP, answered for the VM itself and private address ranges only (10.0.0.0/8, 172.16.0.0/12, 192.168.0.0/16, 100.64.0.0/10, fd00::/8, fe80::/10); every other address is refused, so it is never an open resolver
  • DNSSEC validation on, with the root trust anchor in C:\ProgramData\Unbound\root.key, kept current automatically (RFC 5011, and unbound-anchor at every service start)
  • Windows Firewall rules Unbound DNS (UDP-In) and Unbound DNS (TCP-In), allowing port 53 in for unbound.exe from the private ranges above only
  • unbound-control on 127.0.0.1:8953, secured with this VM's own TLS keys and certificates, made at the first boot of your VM and readable only by administrators (the server's own key also by the service account). No key ships in the image, so no two VMs share one
  • Windows Server 2025 Datacenter, Desktop Experience, version 24H2, build 26100.33828, with Microsoft's November 2026 cumulative update. Windows Update ran during the build and reported nothing pending when the image was captured on 1 December 2026
  • The Azure VM agent, so Azure features such as Reset password and Run command work
  • Accelerated networking supported (on sizes that offer it), Trusted Launch and NVMe sizes supported
  • cloudimg's support team is on hand 24 hours a day by email (support@cloudimg.co.uk), with a guaranteed response within 24 hours

Platform: Microsoft Azure (Gen2 Hyper-V; Trusted Launch, NVMe and accelerated networking supported) Administrator account: the user name and password you choose when you deploy the VM. There is no default Windows password on this image. Configuration: C:\Program Files\Unbound\service.conf

Prerequisites

  1. An Azure subscription
  2. A Remote Desktop client: Remote Desktop Connection (mstsc) on Windows, Windows App (formerly Microsoft Remote Desktop) on macOS, or Remmina on Linux
  3. The public IP address of the machine you will connect from, so you can allow Remote Desktop from that address only
  4. The Azure virtual network your other machines are in: deploy Unbound into it (or into a network peered with it), so they can reach it on its private address

Recommended size: Standard_B2ms (2 vCPUs, 8 GiB memory). That is plenty for the DNS of a few hundred machines; Unbound itself used 13 MB of memory on a new VM.

Step 1: Deploy the Virtual Machine

Option A: Azure Portal

  1. In the Azure Marketplace, search for "Unbound on Windows Server 2025 cloudimg"
  2. Select the offer and click Create
  3. Configure the basics:
  4. Subscription and Resource group: select or create
  5. Virtual machine name and Region: your choice (the same region as your other machines)
  6. Size: Standard_B2ms recommended
  7. Under Administrator account, enter a Username and a Password that you choose. Azure refuses reserved names such as "administrator", "admin" and "guest"
  8. Under Inbound port rules, allow RDP (3389). Azure then opens port 3389 to the whole internet, so restrict it straight after deployment (step 8). Do not open port 53 to the internet: your virtual network reaches it without any rule
  9. On the Networking tab, choose the Virtual network and Subnet your other machines use
  10. Click Review + create, then Create
  11. When the deployment finishes, open the VM's Networking (Network settings) page and edit the inbound rule for port 3389: set Source to My IP address (or your office or VPN address range)

Note the VM's Private IP address on its Overview page: it is the DNS server address your other machines will use (Step 5).

Option B: Azure CLI

Accept the offer terms once per subscription, then create the VM in your virtual network with no inbound rules. Leave out --admin-password and the CLI asks for the password, which keeps it out of your shell history:

az vm image terms accept --urn cloudimg1647283583153:unbound-windows-server:default:latest

az vm create \
  --resource-group myResourceGroup \
  --name my-unbound \
  --image cloudimg1647283583153:unbound-windows-server:default:latest \
  --size Standard_B2ms \
  --vnet-name myVnet --subnet default \
  --admin-username <your-admin-name> \
  --public-ip-sku Standard \
  --nsg-rule NONE

Then allow Remote Desktop from your own address only, and read the VM's public and private addresses:

az network nsg rule create \
  --resource-group myResourceGroup \
  --nsg-name my-unboundNSG \
  --name allow-rdp-from-my-ip \
  --priority 1000 \
  --direction Inbound --access Allow --protocol Tcp \
  --destination-port-ranges 3389 \
  --source-address-prefixes <your-public-ip>/32

az vm list-ip-addresses --resource-group myResourceGroup --name my-unbound \
  --query "[0].virtualMachine.network.{public:publicIpAddresses[0].ipAddress, private:privateIpAddresses[0]}" -o table

No rule is needed for DNS: Azure's default AllowVnetInBound rule already lets machines in the same (or a peered) virtual network reach port 53.

Step 2: Connect with Remote Desktop

  1. Open your Remote Desktop client and connect to the VM's public IP address
  2. Windows: run mstsc, enter the IP address and click Connect
  3. macOS: in Windows App, add a PC with the IP address
  4. Linux: in Remmina, create an RDP connection to the IP address
  5. When asked for credentials, sign in as <vm-name>\<your-admin-name> with the password you set at deployment. On Windows, choose More choices, then Use a different account
  6. Accept the certificate warning: the VM uses a self-signed Remote Desktop certificate

Windows may show its privacy settings screen at your first sign-in; choose your settings and click Accept.

Unbound does not need you to stay signed in: it runs as a Windows service from the moment the VM starts.

The service shows in Services (services.msc) as Unbound DNS validator: Running, Automatic, logging on as NT SERVICE\unbound:

The Services console over Remote Desktop with Unbound DNS validator selected: Running, Automatic, logging on as NT SERVICE\unbound

Step 3: Check that Unbound is running

Open Windows PowerShell as administrator (right-click the Start button, then Terminal (Admin)) and run:

Test-Path C:\ProgramData\unbound-firstboot.done
Get-CimInstance Win32_Service -Filter "Name='unbound'" | Format-Table Name, State, StartMode, StartName -AutoSize
cd 'C:\Program Files\Unbound'
.\unbound-control.exe status

On a new VM:

True

Name    State   StartMode StartName
----    -----   --------- ---------
unbound Running Auto      NT SERVICE\unbound

version: 1.26.2
verbosity: 1
threads: 1
modules: 2 [ validator iterator ]
uptime: 1624 seconds
options: control(ssl)
unbound (pid 780) is running...

True means the one-time first-boot task has finished (see On Startup). unbound-control status answering at all proves the control channel and this VM's own keys work: it connects to 127.0.0.1:8953 over TLS with the client certificate made at first boot.

What it listens on:

Get-NetTCPConnection -State Listen -OwningProcess (Get-Process unbound).Id | Format-Table LocalAddress, LocalPort -AutoSize
LocalAddress LocalPort
------------ ---------
::                  53
127.0.0.1         8953
0.0.0.0             53

DNS on port 53 on every address (UDP too), and the control port on the loopback address only:

An elevated PowerShell window: the unbound service Running as NT SERVICE\unbound, unbound-control status reporting version 1.26.2 with the validator and iterator modules, and unbound.exe listening on TCP and UDP 53 and on TCP 8953 at 127.0.0.1

Step 4: See DNSSEC validation at work

Ask Unbound for a signed name, then for a name whose signatures are deliberately broken:

Resolve-DnsName nlnetlabs.nl -Server 127.0.0.1 -Type A | Format-Table Name, Type, TTL, IPAddress -AutoSize
Resolve-DnsName dnssec-failed.org -Server 127.0.0.1
Name         Type TTL IPAddress
----         ---- --- ---------
nlnetlabs.nl    A 240 128.140.76.106

dnssec-failed.org : DNS server failure

A broken signature is never answered: the client gets SERVFAIL ("DNS server failure") instead of an address an attacker could have forged. unbound-host, in the same folder, shows the validation result itself:

.\unbound-host.exe -C .\service.conf -v nlnetlabs.nl
.\unbound-host.exe -C .\service.conf -v dnssec-failed.org
nlnetlabs.nl has address 128.140.76.106 (secure)
nlnetlabs.nl has IPv6 address 2a01:4f8:c0c:cdfa::1 (secure)
nlnetlabs.nl mail is handled by 10 mxext3.mailbox.org. (secure)
nlnetlabs.nl mail is handled by 10 mxext4.mailbox.org. (secure)
nlnetlabs.nl mail is handled by 10 mxext1.mailbox.org. (secure)
nlnetlabs.nl mail is handled by 10 mxext2.mailbox.org. (secure)

dnssec-failed.org has address 96.99.227.255 (BOGUS (security failure))
validation failure <dnssec-failed.org. A IN>: no keys have a DS with algorithm ECDSAP256SHA256 from 68.87.72.244 for key dnssec-failed.org. while building chain of trust
dnssec-failed.org has no IPv6 address (BOGUS (security failure))
...

Then ask it on the VM's private address, as a machine in your virtual network does (use your VM's own private address):

Resolve-DnsName www.cloudimg.co.uk -Server 10.20.0.20

An elevated PowerShell window: nlnetlabs.nl answered with its AAAA, A and RRSIG records, dnssec-failed.org refused with DNS server failure, and www.cloudimg.co.uk resolved through the VM's private address 10.20.0.20

Step 5: Point your virtual network at Unbound

Set the virtual network's DNS servers to the Unbound VM's private address. Every machine in the network then uses it once it renews its address (at its next restart, or ipconfig /renew on Windows, sudo networkctl renew eth0 or a reboot on Linux).

Portal: open the virtual network, then Settings > DNS servers, choose Custom, enter the Unbound VM's private IP address and click Save.

Azure CLI:

az network vnet update \
  --resource-group myResourceGroup \
  --name myVnet \
  --dns-servers <unbound-private-ip>

You can also set it on a single machine's network interface instead (Network interface > DNS servers), to try it on one machine first.

The Unbound VM itself also takes the network's DNS setting, which is fine: its own Windows then asks Unbound too.

For high availability, deploy a second Unbound VM (in another availability zone) and list both addresses. Do not add Azure's own DNS (168.63.129.16) or a public resolver as a second server: clients use either one, so a name that fails DNSSEC on Unbound could still be answered by the other.

Azure's internal names and private DNS zones

Unbound resolves from the internet's DNS root, so it does not see names that only Azure DNS knows: the VM host names under internal.cloudapp.net, and any Azure Private DNS zones linked to your network (for example privatelink.blob.core.windows.net for private endpoints). Forward those zones to Azure DNS by adding a forward-zone per zone at the end of service.conf:

# Azure's internal names (internal.cloudapp.net) and private DNS zones come from Azure DNS
forward-zone:
    name: "internal.cloudapp.net."
    forward-addr: 168.63.129.16

Then check the file and restart the service:

.\unbound-checkconf.exe .\service.conf
Restart-Service unbound
Resolve-DnsName "$env:COMPUTERNAME.<your-dns-suffix>" -Server 127.0.0.1 -DnsOnly | Format-Table Name, Type, IPAddress -AutoSize
.\unbound-control.exe list_forwards

Before the forward-zone, the VM's own internal name has no answer; after it:

unbound-checkconf: no errors in .\service.conf

Name                                                           Type IPAddress
----                                                           ---- ---------
ubw-gate-a.o2llqij23shuhd01bguzajqvyh.bx.internal.cloudapp.net    A 10.20.0.10

internal.cloudapp.net. IN forward 168.63.129.16

Your DNS suffix is shown by Get-DnsClient | Where-Object ConnectionSpecificSuffix. Azure DNS answers 168.63.129.16 only from inside Azure, which is where this VM is.

Step 6: The firewall

Port 53 is let in by two Windows Firewall rules, for unbound.exe only and from the private address ranges only. All three firewall profiles are on, blocking every other inbound connection:

Get-NetFirewallProfile -PolicyStore ActiveStore | Format-Table Name, Enabled, DefaultInboundAction -AutoSize
Get-NetFirewallRule -Group 'Unbound DNS' | ForEach-Object { [pscustomobject]@{ Rule = $_.DisplayName; Enabled = $_.Enabled; Action = $_.Action; Protocol = ($_ | Get-NetFirewallPortFilter).Protocol; LocalPort = ($_ | Get-NetFirewallPortFilter).LocalPort; RemoteAddress = ($_ | Get-NetFirewallAddressFilter).RemoteAddress -join ', ' } } | Format-List

An elevated PowerShell window: the Domain, Private and Public firewall profiles enabled with inbound Block, and the Unbound DNS UDP-In and TCP-In rules allowing port 53 from the private address ranges only

The same ranges are in Unbound's own access-control lines (Configuration below), so a query from any other address is refused by Unbound even if a firewall or network security group rule were opened by mistake. If your clients reach Unbound from other private ranges (a VPN or ExpressRoute range such as 198.18.0.0/15), add the range in both places.

Step 7: Use unbound-control

unbound-control manages the running resolver without restarting it. Run it from an elevated PowerShell window in C:\Program Files\Unbound (only administrators can read its key):

.\unbound-control.exe stats_noreset | Select-String '^total\.num\.(queries|cachehits|cachemiss)=|^time\.up='
total.num.queries=10
total.num.cachehits=0
total.num.cachemiss=10
time.up=1926.710651

Remove a name, or a whole zone, from the cache (after you change a record and do not want to wait for its TTL):

.\unbound-control.exe flush www.cloudimg.co.uk
.\unbound-control.exe flush_zone cloudimg.co.uk
ok
ok removed 1 rrsets, 0 messages and 0 key entries

See which name servers Unbound would ask for a name, and read the configuration again after you edit it:

.\unbound-control.exe lookup www.cloudimg.co.uk
.\unbound-control.exe reload
The following name servers are used for lookup of www.cloudimg.co.uk.
;rrset 85226 4 0 2 0
cloudimg.co.uk. 85226   IN  NS  ns-1489.awsdns-58.org.
cloudimg.co.uk. 85226   IN  NS  ns-239.awsdns-29.com.
...
ok

reload empties the cache. .\unbound-control.exe with no arguments lists every command.

Step 8: Keeping Windows and Unbound up to date

Windows: Windows Update is on, as in Microsoft's image. Check for updates in Settings > Windows Update, and plan restarts: Unbound starts again by itself after a restart, and machines that use it get no DNS while the VM restarts (another reason for a second Unbound VM).

Unbound: NLnet Labs publishes new versions with release notes at nlnetlabs.nl/projects/unbound/download. To upgrade, download the Windows build unbound-<version>.zip and its .sha256 file from https://nlnetlabs.nl/downloads/unbound/, check the two hashes match, then copy the new programs in from an elevated PowerShell window. Only the .exe files are copied, so your service.conf and this VM's keys stay as they are:

(Get-FileHash .\unbound-<version>.zip -Algorithm SHA256).Hash
Get-Content .\unbound-<version>.zip.sha256
Expand-Archive .\unbound-<version>.zip -DestinationPath $env:TEMP\unbound-new -Force
Stop-Service unbound
Copy-Item $env:TEMP\unbound-new\*.exe 'C:\Program Files\Unbound\' -Force
Start-Service unbound
& 'C:\Program Files\Unbound\unbound-control.exe' status | Select-Object -First 1

With 1.26.2 the two hashes read 1274C4798EE418601B422E2C8112503844B4644F4BAD73E6A691DA8C9D1BC0D6 and 1274c4798ee418601b422e2c8112503844b4644f4bad73e6a691da8c9d1bc0d6 (the same value), and the last line version: 1.26.2.

The DNSSEC root trust anchor needs nothing from you: Unbound keeps root.key current (RFC 5011), and unbound-anchor checks it at every service start.

Server Components

Component Version or setting Where
Unbound 1.26.2 (NLnet Labs' Windows 64-bit build) C:\Program Files\Unbound\unbound.exe
Service unbound ("Unbound DNS validator"), NT SERVICE\unbound, Automatic, restarted on failure Services
DNS UDP and TCP 53, every address; answered for the VM and private ranges only service.conf, firewall group "Unbound DNS"
unbound-control 127.0.0.1:8953, TLS with this VM's own keys C:\ProgramData\Unbound\
DNSSEC trust anchor the root zone's KSK, RFC 5011 automatic updates C:\ProgramData\Unbound\root.key
Windows Server 2025 Datacenter, Desktop Experience, 24H2, build 26100.33828

Configuration

C:\Program Files\Unbound\service.conf is Unbound's configuration file (the service reads it; example.conf beside it is upstream's fully commented reference). Its main settings:

interface: 0.0.0.0
interface: ::0
port: 53
do-ip6: yes
access-control: 0.0.0.0/0 refuse
access-control: ::0/0 refuse
access-control: 127.0.0.0/8 allow
access-control: ::1 allow
access-control: 10.0.0.0/8 allow
access-control: 172.16.0.0/12 allow
access-control: 192.168.0.0/16 allow
access-control: 100.64.0.0/10 allow
access-control: fd00::/8 allow
access-control: fe80::/10 allow

It also turns on QNAME minimisation, prefetching, the DNSSEC hardening options, and hides the server's identity and version (a version.bind query is refused). Log messages go to the Windows Application event log (source unbound) at verbosity 1.

After any change, check the file and then reload or restart:

.\unbound-checkconf.exe .\service.conf
.\unbound-control.exe reload
unbound-checkconf: no errors in .\service.conf
ok

Filesystem Layout

Path What it holds
C:\Program Files\Unbound\ unbound.exe, unbound-control.exe, unbound-checkconf.exe, unbound-host.exe, unbound-anchor.exe, the service install and remove tools, service.conf, example.conf, LICENSE (BSD 3-Clause), README.txt
C:\ProgramData\Unbound\ root.key (the DNSSEC trust anchor) and this VM's unbound_server.key/.pem and unbound_control.key/.pem. SYSTEM and Administrators full control, NT SERVICE\unbound modify; the control key and certificate are SYSTEM and Administrators only
C:\ProgramData\unbound-firstboot.log What the one-time first-boot task did
C:\ProgramData\unbound-firstboot.done Written when the first-boot task finished

The OS disk is Microsoft's 127 GB Windows disk (C:, NTFS, about 110 GB free on a new VM).

Managing the Service

From an elevated PowerShell window:

Restart-Service unbound
Get-Service unbound | Format-Table Name, Status, StartType -AutoSize
Name     Status StartType
----     ------ ---------
unbound Running Automatic

Stop-Service unbound and Start-Service unbound stop and start it; to keep it stopped across restarts, also run Set-Service unbound -StartupType Disabled (and -StartupType Automatic to undo). Machines that use this VM for DNS get no answers while it is stopped.

On Startup

At the first start of your VM, the scheduled task \cloudimg\Unbound first boot (SYSTEM) runs once:

  1. It waits until Windows setup and Azure have finished setting up the VM
  2. It checks C:\ProgramData\Unbound holds only the trust anchor, with its locked-down permissions
  3. It makes this VM's own unbound-control keys: a 3072-bit RSA server key with a self-signed certificate, and a 3072-bit RSA client key with a certificate signed by it (as upstream's unbound-control-setup does), each file created with its permissions already in place
  4. It checks the configuration, sets the service to Automatic, starts it and waits until unbound-control status answers
  5. It writes C:\ProgramData\unbound-firstboot.done, then deletes its own task and script
Get-Content C:\ProgramData\unbound-firstboot.log
2026-12-01T19:23:27.3295508Z provisioning finished
2026-12-01T19:23:34.1285657Z unbound-control keys made: server E65D8E03C374943506F6A1E690A1C80084F3785C control 26AF9A66D5BB740E2D3E2CDAA91D6C1E9F0E3CFC
2026-12-01T19:24:10.0376309Z unbound answers unbound-control: version: 1.26.2
2026-12-01T19:24:52.0844905Z first boot done

It runs only once, so there is nothing to turn off. Every start after that, Windows starts the unbound service, which refreshes the trust anchor and starts resolving.

Troubleshooting

unbound-control says it cannot connect, or unbound-firstboot.done is missing

The first-boot task may still be running: give it a minute or two after the VM starts and check again. Its log, above, shows how far it got. A failure leaves the task in place, so it tries again at the next start.

unbound-control fails in a normal PowerShell window

Only administrators can read the control key: run PowerShell as administrator.

Machines in the virtual network get no answer

  • Check the Unbound VM's private address is the DNS server in the virtual network (or network interface) settings, and that the machine has renewed its address since (Step 5)
  • Check the machine's address is in one of the private ranges (Step 6); add yours to both access-control and the two firewall rules if not
  • Check no network security group rule above AllowVnetInBound blocks port 53 between the subnets
  • From the machine, ask Unbound directly: Resolve-DnsName www.cloudimg.co.uk -Server <unbound-private-ip> (Windows) or dig @<unbound-private-ip> www.cloudimg.co.uk (Linux)

A name resolves elsewhere but gets "DNS server failure" from Unbound

The name's DNSSEC is probably broken (as with dnssec-failed.org in Step 4): unbound-host -v shows why. That is Unbound protecting you. If you must reach a zone with broken DNSSEC that you trust, add domain-insecure: "<zone>" under server: in service.conf, then check and reload.

"udp connect failed" errors in the Application event log

Azure virtual networks have no IPv6 internet access unless you add it, so Unbound's first attempts to reach some name servers over IPv6 fail; it uses their IPv4 addresses instead and answers normally. These messages are harmless.

Forgot the Windows password

Use Reset password on the VM's page in the Azure portal.

Security Recommendations

  • Keep Remote Desktop restricted to your own address (Step 1), or use Azure Bastion
  • Never open port 53 to the internet in a network security group: your virtual network reaches it without a rule, and Unbound refuses public addresses anyway. Open resolvers are abused for DDoS amplification
  • Keep unbound-control on 127.0.0.1. Its keys are this VM's own; do not copy them to other machines
  • Watch the Windows Application event log (source unbound) for errors, and keep Windows Update on
  • Deploy two Unbound VMs for DNS that survives a restart (Step 5)

Support

cloudimg's support team is on hand 24 hours a day by email (support@cloudimg.co.uk), with a guaranteed response within 24 hours, covering deployment, Remote Desktop access, pointing your network at Unbound, its configuration and upgrades.

All product and company names are trademarks or registered trademarks of their respective holders. Use of them does not imply any affiliation with or endorsement by them.