dnscontrol

This project was born out of a need to have more finer grain control over Java's DNS subsystem.

License

License

GroupId

GroupId

com.openpojo
ArtifactId

ArtifactId

dnscontrol
Last Version

Last Version

0.0.8
Release Date

Release Date

Type

Type

jar
Description

Description

dnscontrol
This project was born out of a need to have more finer grain control over Java's DNS subsystem.
Project URL

Project URL

http://dnscontrol.openpojo.com
Source Code Management

Source Code Management

https://github.com/openpojo/dnscontrol

Download dnscontrol

How to add to project

<!-- https://jarcasting.com/artifacts/com.openpojo/dnscontrol/ -->
<dependency>
    <groupId>com.openpojo</groupId>
    <artifactId>dnscontrol</artifactId>
    <version>0.0.8</version>
</dependency>
// https://jarcasting.com/artifacts/com.openpojo/dnscontrol/
implementation 'com.openpojo:dnscontrol:0.0.8'
// https://jarcasting.com/artifacts/com.openpojo/dnscontrol/
implementation ("com.openpojo:dnscontrol:0.0.8")
'com.openpojo:dnscontrol:jar:0.0.8'
<dependency org="com.openpojo" name="dnscontrol" rev="0.0.8">
  <artifact name="dnscontrol" type="jar" />
</dependency>
@Grapes(
@Grab(group='com.openpojo', module='dnscontrol', version='0.0.8')
)
libraryDependencies += "com.openpojo" % "dnscontrol" % "0.0.8"
[com.openpojo/dnscontrol "0.0.8"]

Dependencies

compile (1)

Group / Artifact Type Version
dnsjava : dnsjava jar 2.1.8

test (3)

Group / Artifact Type Version
com.openpojo : openpojo jar 0.8.10
junit : junit jar 4.12
org.hamcrest : hamcrest-all jar 1.3

Project Modules

There are no modules declared in this project.

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).
.=10.0.0.1,10.0.0.2

# Override DNS lookups for specific hosts
www.openpojo.com=10.1.1.1

# Override DNS lookups for whole domains (starts with "." dot),
# This will override lookups for *.openpojo.com (i.e. some.host.openpojo.com)
.openpojo.com=10.0.2.2

# Suppress any queries that you'd like to never resolve
hiddenhost.openpojo.com=

# Finally if you want to use your current system's DNS servers without having to know the entries.
unchanged.resolution.openpojo.com=SYSTEM

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

java -Dsun.net.spi.nameservice.provider.1=dns,dnscontrol \
     -Ddnscontrol.conf.file=/path/where/dns_control_file

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

java -Dsun.net.spi.nameservice.provider.1=dns,dnscontrol \
     -Ddnscontrol.conf.file=/path/where/dns_control_file \
     -Djdk.net.hosts.file=/path/where/hosts_file
Notes:
  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.
Environment

Currently DNSControl runs on Java 1.7 & 1.8.

Builds on the functionality provided by dnsjava.

com.openpojo

OpenPojo

Java libraries to simplify inherent complexity.

Versions

Version
0.0.8
0.0.7
0.0.6
0.0.5
0.0.4
0.0.3
0.0.2