Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Systemd Service file for no-ip.com dynamic ip updater
# Simple No-ip.com Dynamic DNS Updater
#
# By Nathan Giesbrecht (http://nathangiesbrecht.com)
#
# 1) Install binary as described in no-ip.com's source file (assuming results in /usr/local/bin)
# 2) Run sudo /usr/local/bin/noip2 -C to generate configuration file
# 3) Copy this file noip2.service to /etc/systemd/system/
# 4) Execute `sudo systemctl enable noip2`
# 5) Execute `sudo systemctl start noip2`
#
# systemd supports lots of fancy features, look here (and linked docs) for a full list:
# http://www.freedesktop.org/software/systemd/man/systemd.exec.html
[Unit]
Description=No-ip.com dynamic IP address updater
After=network.target
After=syslog.target
[Install]
WantedBy=multi-user.target
Alias=noip.service
[Service]
# Start main service
ExecStart=/usr/local/bin/noip2
Restart=always
Type=forking
@boomshadow

This comment has been minimized.

Copy link

commented Mar 2, 2017

Thanks, this is exactly what I needed!

@jeandoyon

This comment has been minimized.

Copy link

commented Mar 16, 2017

Thank you!

@audip

This comment has been minimized.

Copy link

commented Apr 28, 2017

Thanks

@jorgejch

This comment has been minimized.

Copy link

commented Jun 10, 2017

Thx!

@bhundven

This comment has been minimized.

Copy link

commented Jul 2, 2017

👍

@saulodebaco

This comment has been minimized.

Copy link

commented Jul 12, 2017

Tks a lot!

@aprobinda

This comment has been minimized.

Copy link

commented Jul 21, 2017

Thank you!

@aaugusto-ies

This comment has been minimized.

Copy link

commented Aug 29, 2017

Thank you! It's perfect: short, concise and to the target!
It worked flawlessly in a Raspeberry Pi 3 with opensuse Leap 43.2

@poppycocker

This comment has been minimized.

Copy link

commented Sep 8, 2017

Great work 👍 👍 👍

@janhar

This comment has been minimized.

Copy link

commented Sep 16, 2017

Thanks

@Marenostrum81

This comment has been minimized.

Copy link

commented Oct 2, 2017

Many thanks!

@olihey

This comment has been minimized.

Copy link

commented Nov 25, 2017

Thanks

@skjnldsv

This comment has been minimized.

Copy link

commented Dec 26, 2017

Thank you! :)
Works perfectly on rpi B+ under Raspbian!

@bobfourie

This comment has been minimized.

Copy link

commented Feb 2, 2018

https://bugzilla.redhat.com/show_bug.cgi?id=1431368
Can't gethostbyname for dynupdate.no-ip.com
Can't get our visible IP address from ip1.dynupdate.no-ip.com

for those that have this error on boot, just change replace:
[Unit]
Description=No-ip.com dynamic IP address updater
Wants=network-online.target
After=network-online.target

Thank you for snippets :)

@lptrickmccarty

This comment has been minimized.

Copy link

commented Mar 12, 2018

Very awesome!!!! Thank you!!!!

@stantonfinley

This comment has been minimized.

Copy link

commented May 12, 2018

Don't forget to do a "sudo systemctl enable noip2.service" to enable this and create the proper symlinks. Then it will run on reboot.

@krystof1119

This comment has been minimized.

Copy link

commented Jul 11, 2018

Thanks! Wrote this myself WAY too many times... but this one is more reliable, somehow.

@nemet

This comment has been minimized.

Copy link

commented Jul 26, 2018

Thanks!

@robinastedt

This comment has been minimized.

Copy link

commented Aug 6, 2018

Thanks! Couldn't get mine to work...

@OdeToSpot

This comment has been minimized.

Copy link

commented Sep 5, 2018

Thanks! Works like a charm :)

@jwmarcus

This comment has been minimized.

Copy link

commented Oct 2, 2018

Perfect! Worked right out of the box for Ubuntu 18.04 LTS. Thanks for sharing!

@BurhanKhan1

This comment has been minimized.

Copy link

commented Oct 19, 2018

Awesome

@Odel

This comment has been minimized.

Copy link

commented Nov 22, 2018

Thanks!

@oldfellla

This comment has been minimized.

Copy link

commented Dec 4, 2018

Thanks dude, that's great for a lazy ass like me :-)
Awesome!

@fabricioitajuba

This comment has been minimized.

Copy link

commented Dec 25, 2018

Thank you!

@jonopare

This comment has been minimized.

Copy link

commented Jan 23, 2019

👍 👍

@hanhha

This comment has been minimized.

Copy link

commented Feb 11, 2019

Thank you very much. It saved me several hours as I've ever remember them.

@Plotnus

This comment has been minimized.

Copy link

commented Jun 7, 2019

Thanks!

@tedheadster

This comment has been minimized.

Copy link

commented Jun 20, 2019

So I think there is a problem. I don't think it re-runs this periodically to update network changes (at least it does not on my machine). Is there a change we can make to do this?

@tedheadster

This comment has been minimized.

Copy link

commented Jun 20, 2019

I figured it out. It turns out the noip2 binary defaults to updating only every 30 DAYS (not minutes). Oddly, you have to do this to change the config file default:

pkill noip2 # stop running daemon
/usr/local/bin/noip2 -U 30 # rewrite /usr/local/etc/no-ip2.conf files with new data
/usr/local/bin/noip2 # restart actual daemon; previous step does NOT do this

@Plotnus

This comment has been minimized.

Copy link

commented Jun 20, 2019

I think the issue here is that when we go to the no-ip2 website we see that our ip hasn't updated for longer than the interval we set.

This happens because, with default values, noip2 only sends updates when the ip changes.

If you want to change this default behavior, you'll want to change two values in noip2.c

  • change the line #define FORCE_UPDATE 0 to #define FORCE_UPDATE 1
  • change the line #define FORCE_INTERVAL (1440 * 30) to be the time period in minutes that you want to force an update. for example if we want to update every 15 minutes we should change it to #define FORCE_INTERVAL(15)

Once you have done this rerun make clean install.

@DanielFloris

This comment has been minimized.

Copy link

commented Jun 21, 2019

Can anyone help me. When I check status, I always get :

   Loaded: loaded (/etc/systemd/system/noip2.service; enabled; vendor preset: enabled)
   Active: failed (Result: exit-code) since Fri 2019-06-21 12:59:07 BST; 10s ago
  Process: 7405 ExecStart=/usr/local/bin/noip2 (code=exited, status=0/SUCCESS)
 Main PID: 7406 (code=exited, status=255)

Jun 21 12:59:07 raspberrypi systemd[1]: noip2.service: Failed with result 'exit-code'.
Jun 21 12:59:07 raspberrypi systemd[1]: noip2.service: Service hold-off time over, scheduling restart.
Jun 21 12:59:07 raspberrypi systemd[1]: Stopped No-ip.com dynamic IP address updater.
Jun 21 12:59:07 raspberrypi systemd[1]: noip2.service: Start request repeated too quickly.
Jun 21 12:59:07 raspberrypi systemd[1]: Failed to start No-ip.com dynamic IP address updater.
Jun 21 12:59:07 raspberrypi systemd[1]: noip2.service: Unit entered failed state.
Jun 21 12:59:07 raspberrypi systemd[1]: noip2.service: Failed with result 'exit-code'.
@tedheadster

This comment has been minimized.

Copy link

commented Jun 21, 2019

@MarkRMonaco

This comment has been minimized.

Copy link

commented Jul 15, 2019

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.