ddclient updating to local IP instead of public IP

11

4

I'm trying to setup ddclient on my ubuntu server to update my DNS records on zoneedit for when my public IP changes.

It's updating fine, the problem is that it's giving zoneedit my local IP instead of my public one.

SUCCESS:  updating mydomain.com: IP address set to 192.168.0.17 (200: Update succeeded.)

My ddclient config file looks like this:

protocol=zoneedit1
use=if, if=eth0
server=dynamic.zoneedit.com
login='user'
password='password'
mydomain.com

Why is it updating to my local IP instead of my public one?

Update: could this be because I'm behind a router? If so, how should I configure ddclient to get the public IP?

Alex Coplan

Posted 2012-02-12T23:35:55.657

Reputation: 740

Answers

21

Yes, the issue is because you're behind a router. The best solution would be to see if you can install a ddns client on the router itself. Otherwise there are ddns update tools that finger a remote server and ascertain your IP by what this yields.

This can be done by replacing:

use=if, if=eth0

With this:

use=web, web=checkip.dyndns.org/

Which is apparently the default configuration generated by debconf on Debian systems.

deed02392

Posted 2012-02-12T23:35:55.657

Reputation: 2 662

ah - thanks. I presumed ddclient would use a remote server to get the IP, if anyone knows how to set this up that would be great. – Alex Coplan – 2012-02-13T10:42:41.777

now solved - see my answer – Alex Coplan – 2012-02-13T10:58:14.300

2

Replace

use=if, if=eth0

with

use=web, web=my.ip.fi/

Marvin Wiezorke

Posted 2012-02-12T23:35:55.657

Reputation: 21

What does this do? Would you add some information or context as to why this is a solution? – Raystafarian – 2015-12-03T17:49:31.070

my.ip.fi just displays your current ip adress without the "Your current Ip Adress is:..." thing. So you can CURL it too – Marvin Wiezorke – 2015-12-07T07:24:11.367

Please add that information to your answer and an example of how it's different than the already accepted answer, otherwise it just looks like a duplicate answer with a different site. – Raystafarian – 2015-12-07T09:02:10.283

http://icanhazip.com/ also only displays IP – warhansen – 2019-08-27T12:21:50.857