grep jason_
omg.lol

NextDNS Setup

The other day, Andrew mentioned NextDNS and it sounded pretty cool. I liked the idea of pi-hole, but didn't want another service to manage on my home server. NextDNS is pretty easy to setup and get going, but there is one hang up for people who do not have a static IP from their ISP. Below is a pretty simple way to automate updating your ISP IP with NextDNS to keep the service running smoothly.

High level overview of getting it all going the way I did.

  1. Change the DNS entries in your router, generally in your router settings 192.168.0.1
  2. Check your devices to ensure they are not setup to use other custom DNS entries from other services you may have tried in the past.
  3. If you have a static IP from your ISP, you are done. Mine is not technically static, but has yet to change since starting the service. Just in case it ever does I am using the following to update NextDNS with my current ISP IP address.

Create a new simple .sh script to simply run the url provided by NextDNS to update them with my current ISP IP.

Shell Script (nextdns_ip_update.sh)

curl https://link-ip.nextdns.io/XXXXXX/YYYYYYYYYYYYYYYY

XXXXXX = Endpoint ID from NextDNS Dashboard
YYYYYYYYYYYYYYYY = Random String from NextDNS Dashboard

Launch Agent (update_nextdns_ip.plist)
A simple .plist that is placed in /Library/LaunchAgents set to run the .sh every 3 hours. (3 hours might be a bit aggressive?) There is also a .log file in case anything goes wrong.

<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">

<plist version="1.0">
    <dict>
        <key>Label</key>
        <string>nextdns ip updater</string>
        <key>StartInterval</key>
        <integer>10800</integer>
        <key>StandardErrorPath</key>
        <string>/Users/jason/nextdns_update_error.log</string>
        <key>EnableGlobbing</key>
        <true/>
        <key>RunAtLoad</key>
        <true/>
        <key>KeepAlive</key>
        <dict>
            <key>SuccessfulExit</key>
            <false/>
        </dict>
        <key>Program</key>
        <string>/Users/jason/Scripts/nextdns_ip_update.sh</string>
        <key>disabled</key>
        <false/>
    </dict>
</plist>