Home > jedns

jedns

Jedns is a project mainly written in Java, it's free.

Java DNS Made Easy Client

OVERVIEW

This is a quickie Java client for the DNS Made Easy Service, per this spec:

http://www.dnsmadeeasy.com/client.txt

It works by fetching an IP address and then submitting it to the DNSME service for updating.

It allows you to write your own Fetcher class to specify how it should fetch the IP address. Currently, there are two fetcher classes implemented:

  • WTRouterIpAddressFetcher (default): parses the status page of a DD-WRT firmware router.

  • LocalSystemIpAddressFetcher: gets a specific IP address from the local system. It defaults to the non-loopback address on 'eth0'. The interface name can be configured.

INSTALLING

Assuming an installation folder of /opt/java/jedns.

  1. set version in pom.xml (here we are using 1.0.0)

  2. package:

mvn clean compile jar:jar

  1. copy jar to a specific folder:

cp target/jedns-1.0.0.jar /opt/java/jedns/

  1. get copies of dependencies and move them to a 'lib' subfolder:

mvn dependency:copy-dependencies

mv target/dependency /opt/java/jedns/lib

The maven pom.xml is configured to write a classpath in MANIFEST.MF so that the jar executable will look for the dependencies under 'lib' when run.

RUNNING

Assuming the directory structure above, you could use a shell script like this:


!/bin/bash

JEDNS_DIR=/opt/java/jedns JAR_FILE="jedns-1.0.0.jar" FETCHER_CLASS="org.cafebueno.jedns.fetcher.LocalSystemIpAddressFetcher" USER=your_dnsmadeeasy_user PASS=your_dnsmadeeasy_password RECORD_ID=comma_delimited_list_of_your_dnsmadeeasy_a_record_id(s)

java -jar $JEDNS_DIR/$JAR_FILE -f $FETCHER_CLASS -u $USER -p $PASS -r $RECORD_ID