Skip to content

mtucci/hosts-dns

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

11 Commits
 
 
 
 

Repository files navigation

hosts-dns

A dead simple DNS server.

It reads records from /etc/hosts and answers type A queries.

No configuration needed.

Usage

Running the binary

Download the latest binary from the release page.

sudo ./hosts-dns

Compiling from source

go get "github.com/miekg/dns"
git clone "https://github.com/mtucci/hosts-dns.git"
cd hosts-dns
go build hosts-dns

Trying it out

Before starting to listen on port 53, hosts-dns will print the list of records parsed from /etc/hosts. Suppose example.com is one of them, you can use dig to test it:

dig @127.0.0.1 example.com

Alternatively, using nslookup:

nslookup example.com 127.0.0.1

Credits

About

A minimal DNS server reading from /etc/hosts

Topics

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages