DannyBoii
Posts: 16
Joined: Wed Jun 23, 2021 8:40 pm

Trying to make dhcp(?) refresh on it's own.

Sun Jul 25, 2021 5:37 pm

I pointed a domain to my ip address with an A record and that's part of the puzzle. I want to make sure if my IP address ever changes because it's dynamic that the domain host knows that it changed. I remember when using VPS hosts I have to point to them with (don't quote me) DDNS. Something like s1.namedood.com and s2.namedood.com but I'm not really sure that's what I'm looking for so. Any help would be appreciated. Thanks!
Last edited by DannyBoii on Wed Jul 28, 2021 8:53 pm, edited 2 times in total.

User avatar
B.Goode
Posts: 12780
Joined: Mon Sep 01, 2014 4:03 pm
Location: UK

Re: Trying to make dhcp(?) refresh on it's own.

Sun Jul 25, 2021 5:57 pm

DannyBoii wrote:
Sun Jul 25, 2021 5:37 pm
I pointed a domain to my ip address with an A record and that's part of the puzzle. I want to make sure if my IP address ever changes because it's dynamic that the domain host knows that it changed. I remember when using VPS hosts I have to point to them with (don't quote me) DDNS. Something like s1.namedood.com and s2.namedood.com but I'm not really sure that's what I'm looking for so. Any help would be appreciated. Thanks!


"Trying to make dhcp(?) refresh on it's own."

"Any help would be appreciated. "


My tiny bit of help: Almost certainly nothing to do with dhcp. More likely something involving dns, which is the distributed database the rest of the world uses to find the IP address of your host.

DannyBoii
Posts: 16
Joined: Wed Jun 23, 2021 8:40 pm

Re: Trying to make dhcp(?) refresh on it's own.

Mon Jul 26, 2021 12:20 am

B.Goode wrote:
Sun Jul 25, 2021 5:57 pm
DannyBoii wrote:
Sun Jul 25, 2021 5:37 pm
I pointed a domain to my ip address with an A record and that's part of the puzzle. I want to make sure if my IP address ever changes because it's dynamic that the domain host knows that it changed. I remember when using VPS hosts I have to point to them with (don't quote me) DDNS. Something like s1.namedood.com and s2.namedood.com but I'm not really sure that's what I'm looking for so. Any help would be appreciated. Thanks!


"Trying to make dhcp(?) refresh on it's own."

"Any help would be appreciated. "


My tiny bit of help: Almost certainly nothing to do with dhcp. More likely something involving dns, which is the distributed database the rest of the world uses to find the IP address of your host.
Fair. I'm still learning all the lingo for networking. There's so much to search through I get overwhelmed at times.

pidd
Posts: 2508
Joined: Fri May 29, 2020 8:29 pm
Location: Wirral, UK
Contact: Website

Re: Trying to make dhcp(?) refresh on it's own.

Mon Jul 26, 2021 3:13 am

Yes, if you are using DDNS (not VPS) you need to update the DDNS server with your IP address and your domain has to point its nameservers to the DDNS provider.

I use ddclient which is in the repository to do the updates. The default method of identifying your external IP didn't work for me so I had to use a external site to tell me my IP.

In my case my DDNS provider is dynu.com and I also use their IP-finder at checkip.dynu.com

You need to point your domain's nameservers to your DDNS provider, then your DDNS provider will handle all your DNS records (such a A record etc)

Note you cannot have secure mail for the domain that is using DDNS locally, sometimes the DDNS provider will provide an email service but it usually is not free.

My ddclient config looks like ..

Code: Select all

# Configuration file for ddclient generated by debconf
#
# /etc/ddclient.conf
daemon=121
syslog=yes
ssl=yes
quiet=no
pid=/var/run/ddclient.pid
protocol=dyndns2
#use=if, if=eth0
use=web, web=checkip.dynu.com
server=api.dynu.com
login=mylogin
password='mypassword'
wbiz.uk
Edited: spelling error (ddlclient = ddclient)
Last edited by pidd on Tue Jul 27, 2021 10:19 pm, edited 1 time in total.

DannyBoii
Posts: 16
Joined: Wed Jun 23, 2021 8:40 pm

Re: Trying to make dhcp(?) refresh on it's own.

Tue Jul 27, 2021 9:01 pm

Hey guys. I'm in the middle of searching about for instructions on how to use a free ddns service that isn't apart of my domain registrar. I'm using namecheap for my domain and Dynu for my ddns (mostly because there are tutorials for it.) I figured out how to run a script and a crontab to get the script to run by itself, but, I can't get the script to actually connect to the ddns. My ddns service page says I last ran a check on my website at 2021/07/27 13:32:06 and when I run the script that is supposed to connect via my login and update my IP it doesn't refresh the ip or the timestamp. Any help would be appreciated. Thanks!

pidd
Posts: 2508
Joined: Fri May 29, 2020 8:29 pm
Location: Wirral, UK
Contact: Website

Re: Trying to make dhcp(?) refresh on it's own.

Tue Jul 27, 2021 9:17 pm

DannyBoii wrote:
Tue Jul 27, 2021 9:01 pm
Hey guys. I'm in the middle of searching about for instructions on how to use a free ddns service that isn't apart of my domain registrar. I'm using namecheap for my domain and Dynu for my ddns (mostly because there are tutorials for it.) I figured out how to run a script and a crontab to get the script to run by itself, but, I can't get the script to actually connect to the ddns. My ddns service page says I last ran a check on my website at 2021/07/27 13:32:06 and when I run the script that is supposed to connect via my login and update my IP it doesn't refresh the ip or the timestamp. Any help would be appreciated. Thanks!
As per my post immediately before yours, use ddclient, it is in the Pi repository, you don't need any scripts to run it, it runs as a systemd service.

I can't remember if you have to kick it off but if you do you only need to do it once with (which won't do any harm if it is already running - in fact it will pick up you latest settings)

Code: Select all

sudo systemctl enable ddclient
sudo systemctl restart ddclient

DannyBoii
Posts: 16
Joined: Wed Jun 23, 2021 8:40 pm

Re: Trying to make dhcp(?) refresh on it's own.

Tue Jul 27, 2021 9:42 pm

pidd wrote:
Tue Jul 27, 2021 9:17 pm
DannyBoii wrote:
Tue Jul 27, 2021 9:01 pm
Hey guys. I'm in the middle of searching about for instructions on how to use a free ddns service that isn't apart of my domain registrar. I'm using namecheap for my domain and Dynu for my ddns (mostly because there are tutorials for it.) I figured out how to run a script and a crontab to get the script to run by itself, but, I can't get the script to actually connect to the ddns. My ddns service page says I last ran a check on my website at 2021/07/27 13:32:06 and when I run the script that is supposed to connect via my login and update my IP it doesn't refresh the ip or the timestamp. Any help would be appreciated. Thanks!
As per my post immediately before yours, use ddclient, it is in the Pi repository, you don't need any scripts to run it, it runs as a systemd service.

I can't remember if you have to kick it off but if you do you only need to do it once with (which won't do any harm if it is already running - in fact it will pick up you latest settings)

Code: Select all

sudo systemctl enable ddclient
sudo systemctl restart ddclient
Hey; wasn't trying to ignore you. I'll give it a shot and see what happens. I'm hoping all I had to do to use ddns was supply Dynu with my domain name. Thanks for your advice.

pidd
Posts: 2508
Joined: Fri May 29, 2020 8:29 pm
Location: Wirral, UK
Contact: Website

Re: Trying to make dhcp(?) refresh on it's own.

Tue Jul 27, 2021 10:48 pm

If you have problems, just shout, it can be confusing until it all falls in place - once it is up and running you simply forget about it.

DannyBoii
Posts: 16
Joined: Wed Jun 23, 2021 8:40 pm

Re: Trying to make dhcp(?) refresh on it's own.

Wed Jul 28, 2021 8:50 pm

pidd wrote:
Tue Jul 27, 2021 10:48 pm
If you have problems, just shout, it can be confusing until it all falls in place - once it is up and running you simply forget about it.
I haven't had too much time in the past day or so to work with it, but I did notice that in the initial set up it asks me about a dns protocol and my dns isn't on the list. I'm going to try tojust skip past it and work with the config you posted when I get some time. Thanks for all your help.

DannyBoii
Posts: 16
Joined: Wed Jun 23, 2021 8:40 pm

Re: Trying to make dhcp(?) refresh on it's own.

Fri Jul 30, 2021 7:08 pm

Afternoon, guys.

I spent some time trying to figure out what my next step should be. I *think* I have ddclient started, but, when I type the command;

Code: Select all

sudo systemctl enable ddclient
ddclient.service is not a native service, redirecting to systemd-sysv-install.
Executing: /lib/systemd/systemd-sysv-install enable ddclient
That happens.


I can run ddclient with "sudo ddclient" and if I clear the cache file it spits out no errors, but, my dynu.com site doesn't update my ip.


My conf file looks like this

Code: Select all

protocol=dyndns2
use=if, if=eth0
server=www.dynu.com
login=user
password='password'
web.site
Anyway, that's where I'm at right now. Any help is appreciated!

pidd
Posts: 2508
Joined: Fri May 29, 2020 8:29 pm
Location: Wirral, UK
Contact: Website

Re: Trying to make dhcp(?) refresh on it's own.

Fri Jul 30, 2021 9:36 pm

That's ok, perhaps systemctl enable wasn't such a good idea.

See if its running with

Code: Select all

systemctl status ddclient
If you repeat it that should count down to every check

pidd
Posts: 2508
Joined: Fri May 29, 2020 8:29 pm
Location: Wirral, UK
Contact: Website

Re: Trying to make dhcp(?) refresh on it's own.

Fri Jul 30, 2021 9:41 pm

You also need more entries in your config, copy everything I put in the earlier example.

You need to use Dynu's api so server=api.dynu.com (not www.dynu.com)

DannyBoii
Posts: 16
Joined: Wed Jun 23, 2021 8:40 pm

Re: Trying to make dhcp(?) refresh on it's own.

Mon Aug 02, 2021 7:36 pm

pidd wrote:
Fri Jul 30, 2021 9:41 pm
You also need more entries in your config, copy everything I put in the earlier example.

You need to use Dynu's api so server=api.dynu.com (not www.dynu.com)
Okay, so the timestamp on dynu updated, but I think the site is in another timezone.

2021/08/02 12:32:03

Other than that, I think it works! Holy Moly! xD Thanks a bunch. The client was running since the other day, so, changing the conf file is probably what was needed. Is there a way to check if it is updating the ip? Or is the timestamp changing all I need to look for? (This is harsh on my brain!)

pidd
Posts: 2508
Joined: Fri May 29, 2020 8:29 pm
Location: Wirral, UK
Contact: Website

Re: Trying to make dhcp(?) refresh on it's own.

Mon Aug 02, 2021 8:39 pm

Well done!

Its difficult to test because if your IP doesn't change it doesn't update dynu. There is a periodic once a month update. Some ISP's change your IP every time you reboot the router so you could test it with that maybe.

I think you can increase the logging level so it logs every time it tests the IP, its a long time since I've looked at debugging, once its up and running its one of those things that carries on by itself.

A local file you can check is

/var/cache/client/ddclient.cache

That is where it stores the last known IP etc

I have dynu membership which allows me to see the update logs in the control panel. I got it because I had a lot more than the free number of ddns'd domains.

Note that dynu does object to frequent unnecessary updates, I've forgotten what the rate limits are.

DannyBoii
Posts: 16
Joined: Wed Jun 23, 2021 8:40 pm

Re: Trying to make dhcp(?) refresh on it's own.

Tue Aug 03, 2021 4:17 pm

Alright, well thanks! I'll keep an eye for when my website goes down, I may post again if I have too many issues! I'm gonna consider this thread closed, hope to see you on the forums!

Return to “Networking and servers”