Skip to content
Go to file

Latest commit


Git stats


Failed to load latest commit information.
Latest commit message
Commit time

DNSControl Build Status Coverage Status Maven Central

Simplified control over DNS routing in JAVA

When you need more control on which DNS servers to use in Java for certain hosts or domains.

Quick startup

Create a DNS Control configuration file as such:

# Selection order is more specific wins
# For example, if you have a host, domain, and default override, they will be processed in that order.
# The left hand side is the destination to override, the right hand is the list of dns servers to use.
# Left hand entries should be unique, one entry per destination.
# Don't need to suffix your entries with "." dot, this is implied, meaning, default domain will not be appended.

# Setup default DNS servers, this is optional.
# If not defined, the current host DNS servers will be used if unset (i.e. resolv.conf).

# Override DNS lookups for specific hosts

# Override DNS lookups for whole domains (starts with "." dot),
# This will override lookups for * (i.e.

# Suppress any queries that you'd like to never resolve

# Finally if you want to use your current system's DNS servers without having to know the entries.

startup your JVM passing NameService provider as well as DNS routing file

java,dnscontrol \

If you have a hosts file you'd like to also use you may use the property and add it to your startup parameters

java,dnscontrol \
     -Ddnscontrol.conf.file=/path/where/dns_control_file \
  1. The default value for dnscontrol.conf.file is /dnscontrol.conf on root of the classpath.
  2. The Hosts file is the highest priority when it comes to resolution.

Currently DNSControl runs on Java 1.7 & 1.8.

Builds on the functionality provided by dnsjava.

You can’t perform that action at this time.