Updating IP Address In OpenDNS With Raspberry Pi

Like many people I use OpenDNS instead of my internet provider’s DNS. In addition to the speed gains I get (because it’s faster than my provider’s DNS) I like to look at the reports OpenDNS provides. In order for the reports to work OpenDNS needs my IP address. But my IP address is dynamic so every time it changes my reports break. What did I do about? I set up my Raspberry Pi to automatically update my IP address on OpenDNS. Here’s how I did it.

  1. From the command line type the following and hit enter:
    sudo apt-get install ddclient
    When prompted to continue just say yes. It may take a minute for the package to install so be patient.
  2. When the install completes the configuration interface will load. Keep tabbing to OK and hitting enter until the the interface closes.
  3. Once back at the command line type the following and hit enter:
    sudo nano /etc/ddclient.conf
  4. Enter the following in the ddclient.conf:
    #opendns
    daemon=3600
    syslog=yes
    mail=root
    mail-failure=root
    pid=/var/run/ddclient.pid
    use=web, web=myip.dnsomatic.com
    ssl=yes
    server=updates.opendns.com
    protocol=dyndns2
    login=OPENDNS ACCOUNT EMAIL ADDRESS
    password='PASSWORD'
    NAME OF NETWORK

    OPENDNS ACCOUNT EMAIL ADDRESS should be the email account you use for your OpenDNS account.
    PASSWORD should be your password in single quotes (‘ ‘).
    NAME OF NETWORK should be the name you gave your network in your OpenDNS settings.

  5. Hit CTRL-X to exit nano. When prompted to save be sure to say yes and hit enter to confirm the file name.
  6. From the command line type the following and hit enter:
    sudo nano /etc/default/ddclient
  7. Find run_ipup and change the setting to false.
  8. Find run_daemon and change the setting to true.
  9. Find daemon_interval and change the setting to 3600.
  10. Hit CTRL-X to exit nano. When prompted to save be sure to say yes and hit enter to confirm the file name.
  11. Restart ddclient by typing the following at the command line and hitting enter:
    sudo /etc/init.d/ddclient restart
    If all went well you’ll see the following line and then be back at the command line:
    [ ok ] Restarting ddclient (via systemctl): ddclient.service.

This will now update your IP address on OpenDNS every 60 minutes. If you want to change the interval then change the daemon setting in /etc/ddclient.conf and the daemon_interval setting in /etc/default/ddclient to the desired time (in seconds).

To see if this all works type the following at the command line and hit enter:
sudo ddclient -daemon=0 -debug -verbose -noquiet

Tags: ,

If you enjoyed this post, please consider to leave a comment or subscribe to the feed and get future articles delivered to your feed reader.

Comments

Thanks so much Dave for documenting these instructions. I know just enough to be dangerous in Linux, and as a Raspberry Pi newbie, this was really helpful! This is the main reason I bought the Pi, to run this app since I don’t normally keep another computer running all the time at home.

Some apps don’t automatically launch on the pi from what I have heard. Did this launch on boot for you or do you have to start the application each time?

Thanks,

– Mark

Mark – Yes, this will launch on boot.

Dave,

Thank you for the guide! I do have a question/issue though. When I run “sudo ddclient -daemon=0 -debug -verbose -noquiet” I get a string of failed commands at the end (posted below). How do I know if this updated successfully?

FAILED: updating Home: authorization failed (HTTP/1.1 401 Unauthorized
FAILED: Server: nginx
FAILED: Date: Sat, 18 Mar 2017 05:27:29 GMT
FAILED: Content-Type: text/html; charset=UTF-8
FAILED: Content-Length: 7
FAILED: Connection: close
FAILED: WWW-Authenticate: Basic realm=”RESTRICTED”
FAILED: Accept-Ranges: bytes
FAILED: X-Varnish: 2553545853
FAILED: Age: 0
FAILED: Via: 1.1 varnish
FAILED:
FAILED: badauth)
Can’t exec “sendmail”: No such file or directory at /usr/sbin/ddclient line 1485.
ddclient: cannot execute command | sendmail -oi root.

I think I figured it out. I tried a password change and it appears to be working now.

Awesome guide, thanks!

Side note, I was also getting errors with the mail section in the config. I tried deleting them and the errors went away when I ran “sudo ddclient -daemon=0 -debug -verbose -noquiet” again.

I haven’t gotten the email feature to work either. I don’t really need this feature and haven’t set up sendmail on my Pi.

I am getting the same errors as Ryan. I have not tried a password change yet, any special characters to avoid in the password? This has been brutal to get working.

I am using the following format for the password line

password=’SamplePass9$’

This look right?

Changed the special character in my password (in ddclient.conf & on OpenDNS.com) and magically it worked. Thanks for the great documentation by Dave and comments from Ryan. You guys made my day!

Leave a comment

(required)

(required)