Help with constantly changing IP address from ISP

My YunoHost server

Hardware: Raspberry Pi 3 at home
YunoHost version: 11.0.10.2
I have access to my server : Through SSH and through the webadmin
Are you in a special context or did you perform some particular tweaking on your YunoHost instance ?: No
If yes, please explain:

Description of my issue

I have a straight-forward set-up where I’ve purchased a domain name from Namecheap and I use my DNS A records to point the domain to my local (residential) IP address to access my server. My ISP (as I hear many do) regularly changes my IP address, so I am forced to frequently (usually multiple times a day) update my DNS records. Namecheap provides a way to do this via an API, but they aren’t currently allowing sign-ups for this feature so I’m forced to update my records manually via the customer portal web interface. I use the diagnostic tool to tell me what the IP address should be so I know what to set in the A records. This information is also frequently emailed to me but my email is on the Yunohost and I can’t get the email if I’m unable to connect to the server, so I have to use the yunohost.local admin portal to log in from the home network, run the diagnostic, get the new IP address, then access Namecheap.com to change the DNS records.

Is there another, faster/easier way I can accomplish this? Can I get the new IP address some other way and from outside the home network? Is there another way to update DNS records? Could it all be automated? (I had thought I could create a script on the yunohost to detect the change and send an update request to Namecheap since it knows what the IP address is supposed to be, but I can’t figure a way to do this without the API.) Is there some way I can point my Domain to the new IP address, or a different IP address that auto-updates to the correct one my ISP is currently serving me?

It’s causing frequent outages for me and my users and it’s quite annoying to have to check it sporadically throughout the day and make sure the IP address in the DNS records is corrected to the current one. My ISP provides a Static IP but for a crazy price and it doesn’t come with any other additional features I’d find valuable so I can’t justify the upgrade. Just looking for a way to keep my DNS records pointing to the correct IP without so much manual intervention.

I don’t have a domain at namecheap but I am using https://www.namecheap.com/domains/freedns/ to update dns for my domains (brought elsewhere) using ddclient.

You can use tunneling software to overcome this.

Proprietary:

Better OSS options:

I’m afraid I may not have enough technical knowledge to deploy one of these solutions. Can you suggest one that is fairly simple/basic to install and operate?

CF Tunnel. It is 1 binary file to install on the server.

Then you point the various subdomains to https://localhost:443 (in Tunnel dashboard) and it works.

@jarod5001’s solution would be the way to go, since it’s your provider’s official way to update dynamic addresses.

I already have Namecheap’s PremiumDNS service. Will that do the same thing?

Update: So it looks like I have access to a Dynamic DNS service at Namecheap. But I’m guessing I need to set something up on the Yunohost as well?

Yes.

As per @jarod5001’s answer, use ddclient. Check out NameCheap’s and ddclient’s documentation. YunoHost should not interfere in that.

You can follow this tutorial

It’s in French but it’s easy to understand

I followed these instructions and ran sudo ddclient -query but got various messages including WARNING: found neither ipv4 nor ipv6 address. I wasn’t able to search for a fix for this. Will this update or do I still need to do something?

Creapy.
Seems like ddclient can’t see outside.
See this if it helps
https://sourceforge.net/p/ddclient/wiki/routers/
Is there anything special in the diagnosis?

Still not seeing where the problem is. Here’s what I can see:


sudo nano /etc/ddclient.conf
# Configuration file for ddclient generated by debconf
#
# /etc/ddclient.conf

daemon=300

ssl=yes

use=web

web=https://dynamicdns.park-your-domain.com/getip

protocol=namecheap

server=dynamicdns.park-your-domain.com

# Domain 1
login=[mylogin]

password='[my password]'

[comma,separated,list,of,servers,with,no,spaces]

sudo systemctl status ddclient
● ddclient.service - Update dynamic domain name service entries
     Loaded: loaded (/lib/systemd/system/ddclient.service; enabled; vendor preset: enabled)
     Active: active (running) since Tue 2022-12-27 15:24:26 PST; 7min ago
       Docs: man:ddclient(8)
   Main PID: 1320845 (ddclient - slee)
      Tasks: 1 (limit: 779)
        CPU: 2.296s
     CGroup: /system.slice/ddclient.service
             └─1320845 ddclient - sleeping for 180 seconds

Dec 27 15:29:33 [my server] ddclient[1321721]: WARNING:   Strict-Transport-Security: max-age=16000000; includeSubDo>
Dec 27 15:29:33 [my server] ddclient[1321721]: WARNING:   CF-Cache-Status: DYNAMIC
Dec 27 15:29:33 [my server] ddclient[1321721]: WARNING:   Server: cloudflare
Dec 27 15:29:33 [my server] ddclient[1321721]: WARNING:   CF-RAY: 7805d6c59ba9ce8c-SJC
Dec 27 15:29:33 [my server] ddclient[1321721]: WARNING:   alt-svc: h3=":443"; ma=86400, h3-29=":443"; ma=86400
Dec 27 15:29:33 [my server] ddclient[1321721]: WARNING:
Dec 27 15:29:33 [my server] ddclient[1321721]: WARNING:   <?xml version="1.0" encoding="utf-16"?><interface-respons>
Dec 27 15:29:33 [my server] ddclient[1321723]: FAILED:   updating [my domain]: Invalid reply.
Dec 27 15:29:33 [my server] ddclient[1321725]: WARNING:  SENT:    https://dynamicdns.park-your-domain.com/update?ho>
Dec 27 15:29:33 [my server] ddclient[1321729]: FAILED:   updating [my domain]: Invalid reply.

sudo ddclient -query
use=if, if=eth0 address is [correct internal ip]
use=if, if=lo address is 127.0.0.1
WARNING:  found neither ipv4 nor ipv6 address
use=if, if=wlan0 address is NOT FOUND
WARNING:  cannot connect to ipdetect.dnspark.com:80 socket: IO::Socket::INET: Bad hostname 'ipdetect.dnspark.com'
WARNING:  found neither ipv4 nor ipv6 address
use=web, web=dnspark address is NOT FOUND
use=web, web=dyndns address is [correct external ip]
use=web, web=loopia address is [correct external ip]
use=web, web=https://dynamicdns.park-your-domain.com/getip address is [correct external ip]

I’m thinking this might be the problem?

WARNING:  cannot connect to ipdetect.dnspark.com:80 socket: IO::Socket::INET: Bad hostname 'ipdetect.dnspark.com'
WARNING:  found neither ipv4 nor ipv6 address

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.