<!-- Do *not* edit this file; it was automatically generated by ej2html Look for a name.ej file with the same name as this filename --> <!-- Last updated Wed Jul 26 10:59:02 2006 --> <HTML><HEAD> <TITLE>Running MaraDNS as a Windows NT/2000/XP service</TITLE> <META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=utf-8"> </HEAD><BODY > <H1>Running MaraDNS as a Windows NT/2000/XP service</H1> <i>Note: This document only applies for the Windows port of MaraDNS</i> <p> It is possible to run the native 32bit-Windows port of MaraDNS as a service that starts up automatically when Windows is started and runs in the background. This document gives step by step instructions on how to do this. These instructions assume one is using Windows XP; they probably can be adapted to work with Windows NT and 2000. <p> The rest of this document will simply call Windows XP "Windows". These directions will <i>not</i> work with Windows 95, 98, or ME. <p> In order to run MaraDNS as a service on Windows, the following is needed: <ul> <li>The native Windows32 port of MaraDNS, with a name like <tt>maradns-1-2-12-win32.zip</tt> <li>A zip file, originally issued by Microsoft and freely available several places on the Internet called "srvany.zip". This file can be easily found via an Internet search engine. The file in question is 24,287 bytes long, has an md5 sum of <tt>7e827466629dea02d8f16648d9c43400</tt>, and a sha1 sum of <tt>e2e2ea3701046eb782bd58ae05fb9face1e03543</tt>. </ul> Once these files are obtained, unpack both <tt>.zip</tt> files by right-clicking on them and selecting "extract all" (Windows XP <i>finally</i> has native zipfile support). The rest of this document will assume that you have extracted all the files in both zip files to the directory <b>c:\maradns</b>. <p> Here are all 12 files that will be in <b>c:\maradns</b> if the files were correctly obtained and extracted: <ul> <li><tt>mararc</tt> <li><tt>readme.txt</tt> <li><tt>run_maradns.bat</tt> <li><tt>maradns.exe</tt> <li><tt>askmara.exe</tt> <li><tt>Askmara.html</tt> <li><tt>pthreadGC2.dll</tt> <li><tt>pthreads-w32-2-6-0-release.tar.bz2</tt> <li><tt>Service.html</tt> <b>Note:</b> This file will <i>not</i> be present if using MaraDNS 1.2.11 or lower <li><tt>srvany.exe</tt> <li><tt>instsrv.exe</tt> <li><tt>srvany.wri</tt> </ul> Since it may be desirable to actually have these files in a directory besides <b>c:\maradns</b>, the rest of this document will have this directory in bold face; substitute <b>c:\maradns</b> with the directory actually containing the above files. <p> At this point, here is what is needed to make MaraDNS a Windows service: <ol> <li>Log in to Windows as a user with administrative privileges.<p> <li>Open up a command prompt by going to the start menu, selecting "run", and typing in <tt>cmd</tt> when Windows asks you what file to run.<p> <li>In the command prompt window, type in the following command: <blockquote><tt> instsrv MaraDNS <b>c:\maradns\</b>srvany.exe </tt></blockquote> <li>Open up the Windows registry editor. This can be done by selecting "run" from the Windows start menu and running the command "regedit". <b>Note:</b> Incorrect usage of the Windows registry editor may cause your system to be unusable, forcing a reinstall of the operating system. Please use this program with the utmost of care. If you are not comfortable editing the registry of your system, or think that you may make an error, please seek the advice of someone more comfortable with the registry editor.<p> <li>Go to the "key" <tt>HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\MaraDNS</tt> This is done by clicking on the "+" to the left of "HKEY_LOCAL_MACHINE", followed by clicking on the now-revealed "+" to the left of the word "SYSTEM" under "HKEY_LOCAL_MACHINE", followed by clicking on the now-revealed "+" to the left of "CurrentControlSet", and so on.<p> <li>Create a new key under <tt>MaraDNS</tt> called <tt>Parameters</tt>. This is done by right-clicking (clicking with the right mouse button) on "MaraDNS", selecting (with the left mouse button) new -> Key, and typing in the name "Parameters" (without the quotes in the name) to replace "New Key #1".<p> <li>Under <tt> HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\MaraDNS\Parameters</tt>, the following three new strings need to be created:<p> <ul> <li><tt>Application</tt> <li><tt>AppParameters</tt> <li><tt>AppDirectory</tt> </ul><p> This is done by going to the <tt> HKEY_LOCAL_MACHINE\system\CurrentControlSet\Services\MaraDNS\Parameters</tt> key, right clicking on the key for each of the above values, selecting "new string value", and selecting one of the above three names. Repeat this process until all of the three above strings are added to the Windows registry.<p> <li>Double click on the newly created <tt>Application</tt> key. Give this key the value "<b>c:\maradns\</b>maradns.exe" (without the quotes).<p> <li>Double click on the newly created <tt>AppParameters</tt> key. Give this key the value "-f mararc" (again, without the quotes).<p> <li>Double click on the newly created <tt>AppDirectory</tt> key, and give it the value "<b>c:\maradns</b>".<p> <li>Now we need to start up the MaraDNS service, and make sure it starts up every time Windows is rebooted. From the Windows desktop, go to Start -> Control Panel -> Administrator tools -> Services.<p> If you can not find "Administrator tools" under the control panel, make sure you are using classic instead of category view (selected on the left hand side of the control panel window), or select "upkeep and maintainence", followed by "Administrator tools".<p> <li>Find the MaraDNS service in the list of services.<p> <li>Double click on the service to bring up its properties.<p> <li>Make sure the MaraDNS service is automatically started up, and start the MaraDNS service.<p> </ol> At this point, the MaraDNS service should be running. To verify this, enter the <b>c:\maradns</b> directory from the <tt>cmd</tt> prompt (the commands are "c:" followed by "cd c:\maradns"). Next, type in the following command: <blockquote> <tt>askmara 1:www.microsoft.com.</tt> </blockquote> The output should look something like this: <pre> # Querying the server with the IP 127.0.0.1 # Question: Awww.microsoft.com. www.microsoft.com. +900 cname toggle.www.ms.akadns.net. toggle.www.ms.akadns.net. +300 a 207.46.19.30 # NS replies: # AR replies: </pre> If not, verify that you have a working internet connection. If you do, make sure MaraDNS is running by seeing if it is listed as "maradns.exe" in the task manager (Cntl + Alt + Del) under the "Processes" tab. Note: If you can't see tabs in the task manager, simply double click in the blank area on the side of the task manager. </BODY></HTML>