OwNS is a personal DNS server. It is designed to solve the problems associated with VPN use, and in particular access to the DNS servers used in the private network.
Owns provides the following features:
- recursion & cache (like dnsmasq)
- use of specific servers per domain or network slice.
- use of a hosts file containing static entries (dnsmasq-style format).
git clone https://github.com/jkerdreux-imt/owns.git
cd owns
make
sudo make install
By default, OwNS uses two configuration files located in /etc/owns/
The forward.yaml
file contains the list of different DNS servers to be used. The servers field contains the list of servers used for this zone. These servers are used according to the domain (direct lookup), or the associated networks (reverse lookup). Example :
- networks:
- 192.168.1.0/24
- 2001:555:4444:3333::/64
domains:
- home
servers:
- udp://[2001:555:4444:3333::254]
- tls://192.168.1.254
- networks:
- 10.0.0.0/8
- 192.44.75.0/24
domains:
- imt-atlantique.fr
servers:
- udp://192.44.75.10
If we search for any domain name ending in .home
, we will only use servers 192.168.1.254
or 2001:555:4444:3333::254
. Same for reverse lookup: We will use the same servers if you query any IP within networks 192.168.1.0/24
or 2001:555:4444:3333::/64
(cidr notation).
- You can use some overlapping in networks, the first one will be used for reverse lookups.
- Entries with no domains and networks are considered as default servers.
Servers can use UDP, TCP, and TLS (known as DoT or DNS over TLS). Specify the scheme in the server list, the format is scheme://IP:port
. Supported schemes are udp://
tcp://
and tls://
. IPv6 address must be surrounded with [_]
, and port is optional.
The hosts.txt
file contains the list of static entries (dnsmasq style), with the following fields: fqdn,ipv4,ipv6, txt
test0.home,192.168.1.2,2001:666:5555:4444::2,test 00 VM
test1.home,192.168.1.3,2001:666:5555:4444::3,test 01 VM
test2.home,192.168.1.4,,test 02 VM
The ipv6 and txt fields are optional.
OwNS provide a systemd
unit file and you can enable it as usual with systemd.
sudo systemctl [start|stop|enable|disable|status] owns
Usage of owns:
-bindAddr string
Address to which the server should bind (default "[::]")
-confDir string
Configuration directory (default "/etc/owns")
-logLevel string
Log level (e.g., INFO, DEBUG) (default "INFO")
-port int
Port on which the server should listen (default 53)
Add support for DoT.
- This is my first real program in Golang, so it may contain some errors, but I use it as my daily NS for quite a long time now.
- There is no default zone associated with hosts file. So, if you query a local host which is not in the hosts file, OwNS will forward the query to the default servers (DNS leak..)