Skip to content

Svedrin/win-dns-api-go

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

37 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Windows DNS API (GoLang)

===========

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!

Basic usage

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 and type.

  • /dns/<zoneName>/<dnsType>/<nodeName>/remove (DELETE)

    Removes all records of the given type for the given nodeName.

Running Win-DNS-API-Go for testing

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.

Running win-dns-api-go as a Windows service

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

About

Windows DNS API in Golang

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Go 97.9%
  • Shell 2.1%