D.2. Compiling PowerDNS on Windows

By Michel Stol ().

D.2.1. Assumptions

I will assume these things from you:

D.2.2. Prequisites

Although we tried to keep PowerDNS for Windows' dependencies down to a minimum, you will still need some programs and libraries to be able to compile the sources.

D.2.3. Nullsoft Installer

For our installation program we used Nullsoft's Installer System (NSIS). We used NSIS because it's easy to use, versatile and free (and it uses SuperPiMP technology, but they refuse to tell us what it is ;)). If the name Nullsoft rings a bell, it's because they're the guys who made winamp.

D.2.3.1. Getting the Nullsoft Installer

The Nullsoft Installer can be downloaded at their website, which is located at http://www.nullsoft.com/free/nsis/. The file that you should download is called nsisXXX.exe (where XXX is the latest version).

Note

You can find the NSIS documentation at that website too.

D.2.4. Setting up the build-environment

Before starting Microsoft Visual C++ and compile PowerDNS for Windows, you first have to set up your build environment.

D.2.4.1. Make Microsoft Visual C++ recognize *.cc and *.hh (optional)

All PowerDNS source files are in the form name.cc, and all header files in the form name.hh. These extensions aren't recognized by MSVC by default, so you might want to change that first.

Note

Only perform this step if you want to be able to edit the *.cc and *.hh files in MSVC.

Caution

If you decide to perform this step, remember that it requires modification of the Windows registry, always make a backup before modifying!

Ok, after that word of caution we can now proceed. You have to follow these steps:

  1. Start the registry editor by entering regedit.exe in the run prompt (Start->Run...).

  2. Right click on HKEY_CLASSES_ROOT and select New->Key. A new key will appear, change that key to ".cc", then change the default value to "cppfile"

    Then perform the same step for ".hh" (use "hfile" instead of "cppfile").

  3. Go to HKEY_CURRENT_USER\Software\Microsoft\DevStudio\6.0\Build System\Components\Platforms\Win32 (x86)\Tools\32-bit C/C++ Compiler for 80x86. And add ";*.cc" to the Input_Spec value (so that it becomes "*.c;*.cpp;*.cxx;*.cc").

    Note

    If you happen to use another platform (like alpha) to compile the sources, you have to do the step above for that platform.

  4. Go to HKEY_CURRENT_USER\Software\Microsoft\DevStudio\6.0\Search. And add ";*.cc;*.hh" to the FIF_Filter value (so that it becomes "*.c;*.cpp;*.cxx;*.tli;*.h;*.tlh;*.inl;*.rc;*.cc;*.hh").

  5. Finally change HKEY_CURRENT_USER\Software\Microsoft\DevStudio\6.0\Text Editor\Tabs/Language Settings\C/C++. And add ";cc;hh" to the FileExtensions value (so that it becomes "cpp;cxx;c;h;hxx;hpp;inl;tlh;tli;rc;rc2;hh;cc").

  6. Close the registry editor.

Now should MSVC properly recognize the files as being C++.

D.2.5. Compilation

Finally, after all the reading, installing and configuring we are ready to start compiling PowerDNS for Windows.

D.2.6. Miscellaneous

Some miscellaneous information.

D.2.6.2. Contact information

If you have a comment, or a bug report concerning either this document or the PowerDNS sources you can contact

For general information about PowerDNS, the pdns server, express, documentation etc. I advice you to visit http://www.powerdns.com/

If you are interested in buying PowerDNS you can send a mail to or you can visit the PowerDNS website at http://www.powerdns.com/pdns/

If you want to praise my work, ask me to marry you, deposit $1.000.000 on my bank account or flame me to death, then you can mail me at :)