# 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 daemon-reload` | |
# 5) Execute `sudo systemctl enable noip2` | |
# 6) 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 |
Hi,
I experience a different behavior:
When run from command line noip2 forks and stays running as a daemon. I can see it using 'ps aux'.
When run as a systemd service, is does not fork and using type=forking does not work for me.
I had to switch to type=simple. But now noip2 exits after updating the IP.
It seems it is expecting to be run as a systemd timer.
How can noip2 behave so differently depending on how you call it...?
Nice job it works and helps by just copy/pasting
Thank you works perfectly. cheers
Thank you very much
I was so close, but no cigars..... now my noip2.service purrs like a kitten. Thank you!
I was having this error as well in a Raspbian installation:
Can't gethostbyname for dynupdate.no-ip.com
Can't get our visible IP address from ip1.dynupdate.no-ip.com
Found a workaround, just add to noip2.service file:
[Service]
ExecStartPre=/bin/sh -c 'until ping -c1 google.com; do sleep 1; done;'
After rebooting, now it works. systemctl status noip2.service
:
Dec 15 02:51:35 msdos sh[674]: ping: google.com: Temporary failure in name resolution
Dec 15 02:51:36 msdos sh[674]: ping: google.com: Temporary failure in name resolution
Dec 15 02:51:37 msdos sh[674]: PING google.com() 56 data bytes
Dec 15 02:51:37 msdos sh[674]: 64 bytes from (): icmp_seq=1 ttl=119 time=10.7 ms
Dec 15 02:51:37 msdos sh[674]: --- google.com ping statistics ---
Dec 15 02:51:37 msdos sh[674]: 1 packets transmitted, 1 received, 0% packet loss, time 0ms
Dec 15 02:51:37 msdos sh[674]: rtt min/avg/max/mdev =
Dec 15 02:51:37 msdos systemd[1]: Started No-ip.com dynamic IP address updater.
Dec 15 02:51:37 msdos noip2[1030]: v2.1.9 daemon started with NAT enabled
Dec 15 02:51:41 msdos noip2[1030]: mydns.ddns.net was already set to xxx.xxx.xxx.xxx
Not exactly "pretty" but with all due respect, I've spent three hours using noip2.service files from the whole internet, from centos to slackware to arch linux with no solution.
thank you so much
Wants=network-online.target
After=network-online.target
two lines fixed my problem
Works perfectly wit TurnKey GNU/Linux 16.0 (Debian 10/Buster). Thank you.
On RHEL, where SELinux is enabled, you might need to run:
restorecon /etc/systemd/system/noip2.service
Many thanks for this well-tuned solution Nathan!
On Ubuntu 20.04 I still get the
Can't gethostbyname for dynupdate.no-ip.com
Can't get our visible IP address from ip1.dynupdate.no-ip.com
on boot, despite trying
Wants=network-online.target
After=network-online.target
If anyone knows a more permanent solution than the one above from msdos, I'd love to try it.
Adding that line
[Service]
ExecStartPre=/bin/sh -c 'until ping -c1 google.com; do sleep 1; done;'
eliminates the error and eventually results in getting the correct IP, but it takes no less than 2 minutes and 10 seconds of trying to ping Google before there's a response. Should my network be taking that long to start up? Once it's running, the ping works at one try if I restart the service. It's just startup that takes literally minutes.
Simple and works like a charm. Thank you!
Thanks. Worked great!
thanks all good.
Dont forget to pkill noip2.....then check with noip2 -S
to seen no instances of the program is running, before launching the service
thank you
<3
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.comfor 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.targetThank you for snippets :)
works for me! Thank you.
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'.
Thanks. Works for me!
If anyone has the mentioned problem, make sure to kill all NOIP processes before starting the service. Or restart the machine.
ps aux | grep noip
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'.Thanks. Works for me!
If anyone has the mentioned problem, make sure to kill all NOIP processes before starting the service. Or restart the machine.
ps aux | grep noip
Thank you for this! Was racking my brain for over an hour on this one.
Thanks for this, @NathanGiesbrecht - unfortunately no matter what I do I can't get things to work without the 0.0.0.0 error on my Pi4...
Nov 21 16:32:15 pi400 systemd[1]: Starting No-IP Dynamic DNS Update Client...
Nov 21 16:32:15 pi400 noip2[528]: v2.1.9 daemon started with NAT enabled
Nov 21 16:32:15 pi400 noip2[519]: Can't gethostbyname for dynupdate.no-ip.com
Nov 21 16:32:15 pi400 noip2[519]: Can't get our visible IP address from ip1.dynupdate.no-ip.com
Nov 21 16:32:15 pi400 noip2[519]: ! Last_IP_Addr = 0.0.0.0, IP =
Nov 21 16:32:15 pi400 systemd[1]: Started No-IP Dynamic DNS Update Client.
I've tried various options in the [Unit] settings but all to no avail...
Wants=network-online.target
After=network-online.target
Wants=network-online.target systemd-resolved.service
After=network-online.target systemd-resolved.service
After=network.target
After=syslog.target
BindsTo=NetworkManager.service
After=network.target systemd-resolved.service NetworkManager.service
After=network.target systemd-resolved.service
The only thing that worked in the end was the workaround from @msdos - I just changed it from google.com to no-ip.com to make it feel a tiny bit less hacky! Presumably an issue in Rasperry Pi OS/Debian where it's reporting network as being online before it isn't?
Thanks.
with wireguard this worked for me
Wants=wg-quick@wg0.service network-online.target
After=wg-quick@wg0.service network-online.target
[Service]
ExecStartPre=/bin/sh -c 'until ping -c1 google.com; do sleep 1; done;'
Man, you saved me a lot of time. Thanks
thanks you so much no i can use it.
On Ubuntu 20.04 I still get the
Can't gethostbyname for dynupdate.no-ip.com Can't get our visible IP address from ip1.dynupdate.no-ip.com
on boot, despite trying
Wants=network-online.target After=network-online.target
If anyone knows a more permanent solution than the one above from msdos, I'd love to try it.
Adding that line
[Service] ExecStartPre=/bin/sh -c 'until ping -c1 google.com; do sleep 1; done;'
eliminates the error and eventually results in getting the correct IP, but it takes no less than 2 minutes and 10 seconds of trying to ping Google before there's a response. Should my network be taking that long to start up? Once it's running, the ping works at one try if I restart the service. It's just startup that takes literally minutes.
On CentOS7 and adding that ExecStartPre line saved me from these errors:
Nov 21 16:32:15 pi400 noip2[519]: Can't gethostbyname for dynupdate.no-ip.com Nov 21 16:32:15 pi400 noip2[519]: Can't get our visible IP address from ip1.dynupdate.no-ip.com
[Service]
ExecStartPre=/bin/sh -c 'until ping -c1 google.com; do sleep 1; done;'
@msdos you're the boss. Worked like a charm on my Raspberry Pi OS Lite.
I made some modifications to this to support the 3.0 rust duc client.
Compile the 3.0 linux client using the instructions here: https://www.noip.com/support/knowledgebase/install-linux-3-x-dynamic-update-client-duc/#install_from_source
Also changed how the autorestart works as having it fail permanently if networking is not available is far from ideal.
# Simple No-ip.com Dynamic DNS Updater
#
# By Nathan Giesbrecht (http://nathangiesbrecht.com)
# Modified by Jake (https://github.com/macdja38)
#
# 1) Install binary as described in no-ip.com's source file (assuming results in /usr/local/bin)
# 2) Run sudo /usr/local/bin/noip -C to generate configuration file
# 3) Copy this file noip2.service to /etc/systemd/system/
# 4) Execute `sudo systemctl daemon-reload`
# 5) Execute `sudo systemctl enable noip`
# 6) Execute `sudo systemctl start noip`
#
# 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/noip-duc -g <domain-name> --username <username> --password <password>
Restart=always
RestartSec=5s
StartLimitIntervalSec=0
Essentially without StartLimitIntervalSec
if you don't have internet when the service starts it'll enter a permanent failed state.
Setting StartLimitIntervalSec=0
means it'll try forever.
We don't want to be restarting it every 100ms and having it fail if there's a real error condition though. So we'll set RestartSec=5s
.
Matching the default no-ip update rate.
See here for more info systemd/systemd#2416
Not sure if leaving a password in a systemd service is a great idea, if anyone has a better option I'd love to hear it!
(also renamed service to noip from noip2, maybe noip3 or noip-duc would be a better name)
why syslog? it doesn't exist on ubuntu 22 anymore (https://unix.stackexchange.com/questions/255887/how-to-install-enable-syslog-target)
I had the same state and I thought there was something wrong but not necessarily. Then I found this link. (check Systemd Journal Basics section) https://www.loggly.com/ultimate-guide/linux-logging-with-systemd/ It seems this is the current standard for logs with Systemd systems. Inside the link, I found this rather clear statement: With systemd journal, there is no reason for a traditional syslog utility
Hi
I'm following along with this tutorial:
https://www.youtube.com/watch?v=HTLwGTkBFy4&list=PLjwDNSlPlIIunYlhIRuftmmPmMZlze6WJ&index=13
4mins30seconds
Im getting the following when I run
sudo systemctl enable noip2
error:
/etc/systemd/system$ sudo systemctl enable noip2 Failed to execute operation: No such file or directory
I noticed there is an extra step here to do with the daemon which Ive done but am not really getting it an was hoping it would just work.
Anyone got any ideas, or know how to check if its running properly? I left it at the default 30
Cheers
Answer:
I got this fixed by killing the process with the -K switch(kill proc id didnt do anything as it auto restarted each time) in the readme in noip folder(Dont know why they didnt just put it on the website) and then doing the daemon step later.
Not sure if its 100% right yet because I have to wait for the name servers to replicate around, but Im passed the roadblock of not being able to get tthe service runnign and the restart launch not working. Hope someone else gets