TECH / Windows 5 min read

How to Install a Local Caching DNS Server (ISC BIND) on Windows XP, 7 & 10

Antonio NEMCD Author
Published Apr 3, 2009 · 5 min

If your ISP’s DNS servers frequently lag, drop queries, or you want to host custom internal domain zones on a home or office PC, you can install a full-featured local caching DNS server – ISC BIND – on any Windows machine (from classic Windows XP Home/Pro to Windows 7 and Windows 10) in about ten minutes.

Installing ISC BIND caching DNS server on Windows

A local caching resolver stores IP addresses of visited domains directly in your computer’s RAM: the very first lookup to a new site takes the usual 20–50 ms, while every subsequent request to that domain resolves in 0–1 ms straight from 127.0.0.1 without waiting on external servers.

Step 1. Installing the ISC BIND Service on Windows

Follow these steps to install the service and prepare its directories:

  1. Download ISC BIND for Windows: grab the Windows build from the official ISC archive (downloads.isc.org/isc/bind9/ – look for .W1.zip / .x64.zip packages) or use my preconfigured archive from Step 2 below.
  2. Run BINDInstall.exe: the installer prompts you to set a password for a dedicated low-privilege Windows service account named named so the DNS daemon runs safely in the background.

BINDInstall.exe setup window on Windows

  1. Verify the installation folder and create the var directory: on 32-bit Windows (XP / 7 x86), BIND installs by default to C:\WINDOWS\system32\dns.
    Important 64-bit Windows 7 / 10 / 11 note (from reader comments): on 64-bit Windows, the 32-bit BIND installer is transparently redirected by WOW64 to C:\Windows\SysWOW64\dns (while native x64 builds install to C:\Program Files\ISC BIND 9). Check where the bin and etc folders were created, add a var subfolder for PID and stats files, and verify that the named user has Write permissions on var.

Step 2. Ready-to-Use Configuration Archive and named.conf

By default, the Windows BIND installer unpacks only the binaries into bin and leaves the etc configuration directory empty. Rather than writing root hints (named.root) and RFC 1912 zones from scratch, I adapted a proven FreeBSD configuration and zipped up the working folder structure:

Here is the core C:\WINDOWS\system32\dns\etc\named.conf file (on 64-bit Windows using the 32-bit build, replace system32 with SysWOW64 in the first four path lines):

options {
    directory       "C:\WINDOWS\system32\dns\etc";
    pid-file        "C:\WINDOWS\system32\dns\var\named.pid";
    dump-file       "C:\WINDOWS\system32\dns\var\named_dump.db";
    statistics-file "C:\WINDOWS\system32\dns\var\named.stats";

    allow-query     { 127.0.0.1; };
    allow-recursion { 127.0.0.1; };
    listen-on       { 127.0.0.1; };

    disable-empty-zone "255.255.255.255.IN-ADDR.ARPA";
    disable-empty-zone "0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.IP6.ARPA";
    disable-empty-zone "1.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.IP6.ARPA";

    forwarders {
        1.1.1.1;
        8.8.8.8;
        4.2.2.2;
    };
};

zone "." { type hint; file "named.root"; };

// RFC 1912 Localhost zones
zone "localhost"        { type master; file "master/localhost-forward.db"; };
zone "127.in-addr.arpa" { type master; file "master/localhost-reverse.db"; };
zone "255.in-addr.arpa" { type master; file "master/empty.db"; };
zone "0.ip6.arpa"       { type master; file "master/localhost-reverse.db"; };
zone "0.in-addr.arpa"   { type master; file "master/empty.db"; };

// RFC 1918 Private networks
zone "10.in-addr.arpa"      { type master; file "master/empty.db"; };
zone "168.192.in-addr.arpa" { type master; file "master/empty.db"; };
zone "254.169.in-addr.arpa" { type master; file "master/empty.db"; };

// Uncomment to serve a custom local domain zone:
// zone "mydomain.com" {
//     type master;
//     file "master/mydomain.com.db";
// };

Inside the forwarders block, you can list fast public resolvers (Cloudflare 1.1.1.1, Google 8.8.8.8) or your ISP’s closest DNS servers. To allow other devices on your home LAN (such as 192.168.1.0/24) to query this PC, simply add your subnet and LAN IP to allow-query, allow-recursion, and listen-on.

Step 3. Point Windows Network Settings to 127.0.0.1 and Verify

Open Services (Win + R -> services.msc), locate ISC BIND, and start the service. Next, open your network adapter’s TCP/IPv4 properties and enter 127.0.0.1 as your Preferred DNS server:

Setting 127.0.0.1 as Preferred DNS server in Windows TCP/IP properties

Open Command Prompt and test resolution speed using nslookup or dig:

Testing local BIND DNS server response in Windows Command Prompt

Once a domain is cached, repeat queries return instantaneously. Whenever you need to clear stale cached records after a website changes IP addresses, run ipconfig /flushdns and restart the ISC BIND service.

Related posts:

Leave a Comment