Install DNS server (bind9) on VPS or Cloud – Windows Print

  • 0


Installing Bind on Windows

Download and install the Bind 9 Software

* Download the latest version of bind from
* Create a folder on your desktop called bind and extract the downloaded zip to it.
* Open the newly created bind folder and run BINDInstall.exe
* In the Bind 9 Installer window enter:
o Target Directory: c:named
o Service Account Name: named
o Service Account Password: Enter a secure password to use for the service to use
o Confirm Service Account Password: Enter the password again
o Ensure that Automatic Startup is selected
o Ensure that Keep Config files after uninstall is selected.
* Click Install.
* When the installer reports "BIND Installation completed successfully", click OK.
* Click Exit to close the installer.

Configure Bind

* Create a c:namedzones folder
* Download named.conf and and save them to:
o c:namedetcnamed.conf
* Open a command prompt and run:
o cd c:namedbin
o rndc-confgen -a
o rndc-confgen > ..etcrndc.conf
* Close the command prompt
* Open c:namedetcrndc.conf in notepad
* Cut to the clipboard the section below the line that says:

# Use with the following in named.conf, adjusting the allow list as needed:

* Save & close rndc.conf
* Open c:namedetcnamed.conf in notepad
* Paste the contents of the clipboard into the bottom of this file
* Remove the hashes (#) from the beginning of the pasted lines.
* Remove the line that says "End of named.conf"
* Save & close named.conf

Configure your zone

* Open c:namedetcnamed.conf in notepad.
* In the zone definition for, modify the zone and file lines to reflect the domain you are configuring.
* Save and close named.conf
* Rename to reflect your previous change in named.conf
* Open this zone file in notepad.
* Substitute all references to for the domain you are configuring.
* Substitute namesever-hostname for the hostname of your nameserver.
* Edit the last line so that the A record reflects the IP address of your server.
* Edit the serial line to reflect today's date. The format for this line is YYYYMMDDRR where:

YYYY = The year (e.g. 2005)
MM = The month (e.g. 02)
DD = The day (e.g. 22)
RR = Today's revision of this file (e.g. 01)

* Save and close the zone file.

Start the Bind service

* Start -> Progam Files -> Administrative Tools -> Services
* Locate the "ISC Bind" service, right click on it and select start.
* If it fails to start, errors can be found in the Event Viewer.

Create a Bind Reload batch file

To make reloading your nameserver easier, I recommend placing a batch file on your destop to reload the nameserver. Reloading the nameserver enables Bind to re-read all the configuration and zone files (and thus allow implement any changes) without the need to restart the service.

* Create a text file called "reload bind.bat" on the desktop, with the following content

@echo off
c:namedbinrndc reload

If you wish your Bind server to serve recursion

Should you require your Bind server to allow recursive queries, that is that it will need to be able to look up zones other than the ones you are hosting on this server (e.g. if this is to provide DNS service to a local network), you will need to enable recursion.

You will first need to generate a root hints file so your server knows where the root servers are. Ensure your Windows DNS configuration is pointing to a working DNS server (such as that of your ISP), open a command prompt and run:

c:namedbindig NS . > c:namedzonesdb.root.hint.txt

Now add the following lines to your c:namedetcnamed.conf configuration file:

zone "." IN {

type hint;

file "db.root.hint.txt";


Also, in the global "options" section, change "recursion no" to "recursion yes" and, on the follwing line, add the following line to specify the range of IP addresses which you wish to allow recursion for:

allow-recursion {; };

Reload Bind for these changes to take effect.

Active Directory Integration

Should you wish for BIND to be the authoritate source of information for your Active Directory domain (if you don't know what this is, don't worry about this section) then you will need to delegate some of the special Active Directory subdomains to your Active Directory server.

; The address of my Active Directory server

yourdnsdc IN A

; services over tcp
_tcp IN NS

; services over udp
_udp IN NS

; domain controllers
_msdcs IN NS

; subnet locations
_sites IN NS

Was this answer helpful?

« Back