===========
This is a simple API based on the Win DNS API (Node. JS). It has been rewritten in GoLang mainly for learning purpose and because it seemed more appropriate for this scenario.
This tool acts as an API for Windows Server DNS. With this it is possible to create/edit/delete DNS entries on a Windows Server.
Compiled versions available for Windows 32 and 64 Bits on the releases section
This README will be updated as the project grows. Any contributions are welcomed!
The API defines these URLs:
-
/
(GET
)A simple welcome page.
-
/dns/
(GET
)Lists all DNS zones known to this DNS server.
-
/dns/<zoneName>
(GET
)Lists all DNS records in a given Zone.
-
/dns/<zoneName>/db.txt
(GET
)Generates a Zonefile to be used with a DNS server such as Bind9.
-
/dns/<zoneName>/<dnsType>/<nodeName>/set/<ipAddress>
(POST
)Creates or updates a DNS record. Note this will replace all existing records for the given
nodeName
andtype
. -
/dns/<zoneName>/<dnsType>/<nodeName>/remove
(DELETE
)Removes all records of the given
type
for the givennodeName
.
Compile using GOOS=windows go build
, and just run the .exe
:
C:\Users\your-dns-admin> win-dns-api-go.exe
Listening on port 3111.
The binary can also be installed as a Windows service using this command in a cmd
session started as Administrator.
Note the space behind the equal signs, these are important:
sc create win-dns-api-go start= auto binPath= C:\Users\your-dns-admin\win-dns-api-go.exe
This will create a service named win-dns-api-go
that you can use to run this tool in the background.
If you want to delete the service again, run:
sc delete win-dns-api-go