Skip to content

bodand/d3

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

22 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

d3 (dynamic dns daemon)

d3 is a set of executables written in C++ that provide easily usable utilities to manage self-hosted services that are stuck behind the ISP’s dynamic IP whims.

Note, that d3 is not actually a daemon.

The d3 executables are designed to be used primarily with runit or s6 style service supervisers with snooze, but I’m sure you can shoehorn it into systemd and/or cron as well.

Provided tools

The executables are designed to be reusable across different IP resolvers and DNS providers, although as of right now, only one of each is implemented. (The ones I use.)

From this you can gleam that the two category of tools provided are resolvers and DNS providers. The job of the former is to figure out what the current IP address of the machine/system is. The latter has two subcategories: the lookup tools and updaters. The lookup tools are mostly an easier to handle version of nslookup/dig that is intended to be used with other tools of the d3 suite.

Each of the tools have their own documentation:

d3-resolve

Resolve the current IP address and pass it over to a process on STDIN.

d3-query

Query A and AAAA DNS records.

d3-filter

Filter input lines based on record types and grouped domains.

d3-update

Update DNS records using a selectable backend.

Dependencies

The following dependencies are used by d3:

You will need to provide the required development libraries and headers for these libraries.

Other than that, the following also need to be available on your system for building d3:

  • A POSIX compatible make(1) implementation. If you believe your make(1) is POSIX compliant, yet building fails, please file an issue.

  • Perl v5.38 or above. If you use mise, a mise.toml is provided to ensure a correct version is used.

  • File::Which CPAN (Perl) package.

Building

After acquiring all Dependencies, building d3 should be easily the following:

make [-j<n>] (1)
[doas|sudo] make install [PREFIX=/opt/my/path] (2)
  1. This step configures and builds d3 on your system. To perform parallel compilation the -j<n> flag may be passed to make, if your make(1) supports it.

  2. If you wish to install d3 on your system as well, also run this step. You may optionally need to prefix it with doas (or sudo) to elevate make’s privileges or set a PREFIX for a custom installation directory (default is /usr/local).

Example

An example runit service using execline and snooze to check for required updates every hour and update a Cloudflare DNS entry if your IP has changed is the following:

#!/usr/bin/execlineb -P
export D3_CF_TOKEN my-token (1)
fdmove -c 2 1
exec snooze -H*
   d3-resolve
   d3-query -d my.domain.com
   d3-filter
   d3-update -b cloudflare
  1. If you are concerned for storing the token here, you can easily make this more complex to not do that.

COPYING

For licenses of relied upon external libraries see the docs/licensing.adoc file.

Copyright (c) 2025 {author} <{email}>

Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:

1. Redistributions of source code must retain the above copyright notice, this
   list of conditions and the following disclaimer.

2. Redistributions in binary form must reproduce the above copyright notice,
   this list of conditions and the following disclaimer in the documentation
   and/or other materials provided with the distribution.

THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS “AS IS” AND
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

About

Dynamic DNS Daemon

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages