Windows¶
The Windows executable is a console program that also runs as a Windows service. It is unsigned, so Windows SmartScreen warns the first time you start it. The DNS server, REST API and admin console work. DHCP, Router Advertisement and passive device presence need Linux kernel interfaces and are unavailable.
Before you start¶
- A Windows x86-64 machine and an administrator PowerShell.
- Free ports. The defaults use 53 (UDP and TCP), 80 and 443. To use others, see Ports.
- Download
ninlil-windows-amd64.zipandSHA256SUMSfrom the releases page (the addresses are built as in Find the release tag). The zip holds the executable andmsquic.dll, the library DNS-over-QUIC needs. Both must stay in one folder. - Verify the zip before you accept the SmartScreen warning. In PowerShell,
(Get-FileHash .\ninlil-windows-amd64.zip).Hashmust equal theninlil-windows-amd64.zipline inSHA256SUMS, ignoring case.
Steps: try it from a console¶
-
Remove the download mark, then unzip into a new folder:
Unblock-File .\ninlil-windows-amd64.zip Expand-Archive .\ninlil-windows-amd64.zip -DestinationPath C:\Ninlil -
Check that
Get-ChildItem C:\Ninlillistsninlil-windows-amd64.exeandmsquic.dll. - Run
C:\Ninlil\ninlil-windows-amd64.exe, wait for the log lines and openhttp://localhost/. Press Ctrl+C to stop it. It createdC:\Ninlil\data\.
Steps: run it as a service¶
Run these in an administrator PowerShell.
-
Create the data folder. If you already ran the executable from a console, keep that folder: it holds your database and keys.
New-Item -ItemType Directory -Force C:\Ninlil\data -
Create the service. The space after each
=is required bysc.exe:sc.exe create Ninlil binPath= "C:\Ninlil\ninlil-windows-amd64.exe" start= auto DisplayName= "Ninlil DNS server" -
Run it as a virtual service account instead of LocalSystem. It needs no password:
sc.exe config Ninlil obj= "NT SERVICE\Ninlil" icacls C:\Ninlil\data /grant "NT SERVICE\Ninlil:(OI)(CI)M" -
Register the event source for the log, let Windows restart the service after a crash, open the ports you use and start it:
New-EventLog -LogName Application -Source Ninlil.Web sc.exe failure Ninlil reset= 86400 actions= restart/5000/restart/5000/restart/60000 New-NetFirewallRule -DisplayName "Ninlil DNS" -Direction Inbound -Protocol UDP -LocalPort 53 -Action Allow New-NetFirewallRule -DisplayName "Ninlil DNS (TCP)" -Direction Inbound -Protocol TCP -LocalPort 53 -Action Allow New-NetFirewallRule -DisplayName "Ninlil web" -Direction Inbound -Protocol TCP -LocalPort 80,443 -Action Allow Start-Service Ninlil
Check that it worked¶
Get-Service Ninlil
Invoke-WebRequest http://localhost/status
Get-Service shows Running a few seconds after Start-Service, and the status call answers
{"status":"Healthy",...}.
Behaviour worth knowing¶
- Keep the program folder outside any user profile (such as
C:\NinlilorC:\ProgramData\Ninlil): a service account cannot read the profile of the user who unzipped it. - Service settings go in the service's environment. One
NAME=valueline per setting, as listed in the environment variables, thenRestart-Service Ninlil. - Ninlil writes warnings and errors to the Application event log under the source
Ninlil.Web. When a start is refused, the newest entry whose message containsStartup refused:names the setting. See Exit codes. - Updating means stopping the service, replacing the
.exeandmsquic.dllwith the files from the zip of the version you update to, and starting it again.
The README holds the rest: removing the service, the service account's key storage and how Ninlil claims its ports. See Windows and Ports.