1Copyright (C) 2013, 2014 Internet Systems Consortium, Inc. ("ISC") 2See COPYRIGHT in the source root or http://isc.org/copyright.html for terms. 3 4 BIND 9.10 for Win32 Source Build Instructions. 02-Feb-2014 5 6Building BIND 9.10 on Windows has the following prerequisites: 7 81) You need to install Perl for Windows. ActivePerl 9(http://www.activestate.com/) and Strawberry Perl 10(http://www.strawberryperl.com) have both been tested and found 11to work. 12 132) OpenSSL (http://www.openssl.org) must be downloaded and built on 14the system on which you are building BIND. 15 163) If you wish to use the statistics channel, LibXML2 17(ftp://xmlsoft.org/libxml2) must be downloaded and built on 18the system on which you are building BIND. 19 204) Optional external packages (not used by default) 21 22If you wish to use IP geolocation, GeoIP API and database must be 23downloaded, patched and built on the system on which you are building 24BIND. 25 26If you wish to use readline, the readline library must be downloaded 27and built on the system on which you are building BIND. 28 295) The BIND Installer (BINDInstall) includes a copy of the 30redistributable runtime object vcredist_x86.exe (or vcredist_x64.exe), 31which is included with Visual Studio and can be downloaded from 32Microsoft. This file must be in place prior to running Configure. 33 346) BIND is known to run on the following versions of Windows: 35Windows XP (with Service Pack 2 or higher), Vista, 7, 8, Server 2003, 36Server 2008, Server 2008R2, and Server 2012. 37 38Step 1: Download and build OpenSSL 39 40 OpenSSL is required for DNSSEC. If you wish to build BIND 9 without 41 DNSSEC support, skip to step 2. 42 43 Download and untar the OpenSSL sources from http://www.openssl.org/. 44 Extract them at in the same directory in which you extracted the BIND 9 45 source: If BIND 9 is in \build\bind-9.10.0, for instance, OpenSSL should 46 be in \build\openssl-1.0.1g (subject to version number changes). 47 48 Note: Building OpenSSL requires that you install Perl as it uses it 49 during its build process. The following commands work as of 50 openssl-1.0.1g, but you should check the OpenSSL distribution to see 51 if the build instructions in the INSTALL.W32 (or INSTALL.W64) file 52 have changed, in particular for the assembler options: 53 54 32-bit builds: 55 (In an x86 Visual Studio Command Prompt window) 56 cd openssl-1.0.1g 57 perl Configure --prefix=c:\openssl enable-static-engine VC-WIN32 58 ms\do_ms 59 nmake /f ms\ntdll.mak 60 61 64-bit builds: 62 (In an x64 Visual Studio Command Prompt window) 63 cd openssl-1.0.1g 64 perl Configure --prefix=c:\openssl64 enable-static-engine VC-WIN64A 65 ms\do_win64a 66 nmake /f ms\ntdll.mak 67 68 The "enable-static-engine" option is needed when an OpenSSL engine 69 will be used -- for example, when using the GOST signing algorithm or 70 OpenSSL-based PKCS#11 support. 71 72 If you wish to use OpenSSL-based PKCS#11 to control a cryptographic 73 hardware service module, please see "PKCS#11 (Cryptoki) support" in 74 chapter 4 of the BIND 9 Administrator Reference Guide. You will need to 75 apply the patch in bind9\bin\pkcs11\openssl-1.0.1g-patch (this can be 76 done using the Cygwin 'patch' utility) and add --pk11-libname and 77 --pk11-flavor to the Configure command above. 78 79Step 2: Download and build LibXML2 80 81 LibXML2 is required to use the statistics channel. If you wish to 82 build BIND 9 without support for this feature, skip to step 3. 83 84 Download and untar the libxml2 sources from ftp://xmlsoft.org/libxml2. 85 Extract them in the same directory in which you extracted the BIND 9 86 source: If BIND 9 is in \build\bind-9.10.0, for instance, libxml2 should 87 be in \build\libxml2-2.9.1 (subject to version number changes). 88 89 Now build libxml2, and copy the resulting files into the include and lib 90 directories: 91 92 cd libxml2-2.9.1\win32 93 cscript configure.js compiler=msvc vcmanifest=yes static=yes \ 94 debug=no iconv=no 95 nmake /f Makefile.msvc libxml 96 97Step 3: Download and build GeoIP 98 99 Geographic ("geoip") ACLs require libGeoIP. If you wish to build BIND 9 100 without support for this feature, skip to step 4. 101 102 The libGeoIP source code is available from: 103 104 https://github.com/maxmind/geoip-api-c/releases. 105 106 As of this writing, the current version of libGeoIP is 1.6.0. There 107 is a known bug in this and all prior versions which prevents it from 108 building a suitable DLL with thread support on Windows. You can apply 109 the patch file bind9/win32utils/GeoIP.diff to address the problem. 110 This patch has been submitted upstream, and will be included in 111 future versions of libGeoIP. 112 113Step 4: Download and build Readline 114 115 The readline library adds command-line editing in nslookup and nsupdate. 116 If you wish to build BIND 9 without support for this feature, skip to 117 step 5. 118 119 Because the original GNU source for the readline library has no WIN32 120 support, it will be necessary to download a version of the static 121 readline library source that is ready to be built by Visual Studio. One 122 such version is available at: 123 124 http://gpsim.sourceforge.net/gpsimWin32/gpsimWin32.html#readline_lib 125 126Step 5: Make the redistributable runtime object available 127 128 Check that the Microsoft redistributable object (vcredist_x86.exe or 129 vcredist_x64.exe) is available to the build. The file may be placed 130 in the directory in which the BIND 9 source was extracted (for 131 instance, if BIND 9 is in \build\bind-9.10.0, the redistributable 132 may be placed in \build\vcredist_x86.exe). Or, the path to the file 133 can be specified via the VCREDIST_PATH environment variable, or via 134 the "with-vcredist=PATH" option to the configuration script (see 135 step 4). If none of these options is used, Configure will attempt to 136 find the redistributable based on clues in the build environment. 137 138Step 6: Configuring the BIND build 139 140 From the command prompt, cd to the win32utils directory under 141 the BIND 9 root: 142 143 cd bind-9.10.0\win32utils 144 145 In this directory, you can prepare the Windows build by running: 146 147 perl Configure <options> win32 148 149 For 64 bit: 150 151 perl Configure <options> x64 152 153 This will set up all the files needed for building BIND 9 according 154 to the given options. To see the available options, run: 155 156 perl Configure help 157 158 To remove all files generated by Configure, run: 159 160 perl Configure clean 161 162Step 7: Building BIND 163 164 To build using 'nmake' or older versions of Visual Studio (e.g. 165 VS 2005 or VS 2008), go to the legacy subdirectory: 166 167 cd legacy 168 169 and follow the instructions in win32-build.txt. 170 171 Note: Only 32-bit builds are supported in this mode. 172 173 To build using the Visual Studio GUI in VS 2010 or VS 2012: 174 open the bind9.sln solution file; this will load the project 175 files for all of the BIND 9 libraries and applications. Select 176 "Build->Batch Build", click "Select All", then click "Build". 177 178 To build using MSBuild in VS 2010 or VS 2012: call MSBuild on 179 the bind9.sln solution file: 180 181 msbuild /t:Build /p:Configuration=Release bind9.sln 182 msbuild /t:Build /p:Configuration=Debug bind9.sln 183 184 Note: This mode does not support building for Windows XP. 185 186Step 8: Install 187 188 Installation is accomplished by running the BINDInstall program. All 189 DLL's are copied to the Program Files area and all applications 190 (including BINDInstall which may be necessary for uninstalling BIND 191 9) to the bin directory. If BIND 8 has previously been installed on 192 the system it must be uninstalled first by running it's own 193 BINDInstall program. The BIND 9 installer does not yet do this. 194 195 Note: BINDInstall.exe requires the MFC (Microsoft Foundation Class). 196 This is only distributed with non-free (i.e., not "Express") versions of 197 Visual Studio. The other BIND 9 libraries and applications do not have 198 this dependency. 199 200Please report bugs, whether in the process of building the application 201or in BIND 9 itself, to bind9-bugs@isc.org. 202