OpenNIC auto DNS updater
Switch branches/tags
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
.gitignore v0.90 Feb 16, 2018
LICENSE Create LICENSE Feb 16, 2018
README.md readme Apr 27, 2018
opennic-up replace ; by stderr output Jun 2, 2018
opennic-up.conf fixed conf Feb 17, 2018
opennic-up.service service exec fixed Feb 17, 2018
opennic-up.timer v0.90 Feb 16, 2018

README.md

opennic-up

OpenNIC auto DNS updater

Installation

Manual installation

The opennic-up Bash script can be downloaded to your preferred location. The systemd service and timer provided are to be copied to /usr/lib/systemd/system/.

Arch linux package

For a full integration of the automated update process, an Arch Linux package is available here.

Scheduled update with systemd time

A systemd timer unit is provided, to enable and start the timer that will update the DNS servers twice a week, use:

# systemctl enable --now opennic-up.timer

Dependencies

The tools awk, sort, uniq, curl, fping, xargs, drill are required and must be found in the environment path. For Arch Linux users this corresponds to two additional packages on top of the base distribution which will be installed with the package if not already present: fping and curl.

Syntax

# opennic-up [options]

options:
    -q  quiet
    -v  version
    -h  help

Replaces the DNS servers with the 3 most responsive OpenNIC DNS servers for your location.

  • If Network Manager nmcli is found in the path, it is used to update the DNS entries
  • Otherwise the /etc/resolv.conf file is updated directly with the new nameservers keeping the other options untouched

Configuration

opennic-up.conf is the configuration file for opennic-up.

opennic-up looks for the file at the location /etc/opennic-up.conf. Alternatively it can be saved in the user location ~/.config/opennic-up/opennic-up.conf and in this case it takes precedence over the former.

The configuration file defines the OpenNIC member's user and auth used to register one's IP for whitelisting. For example:

user=myusername
auth=TbuARbBxHHGznNScvVLKZDDR9ZGVKdhqxj8dkzCQ