Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unable to determine IP address #84

Closed
SpencerDub opened this issue Nov 15, 2019 · 14 comments
Closed

Unable to determine IP address #84

SpencerDub opened this issue Nov 15, 2019 · 14 comments

Comments

@SpencerDub
Copy link

I'm still trying to get ddclient set up on my Ubuntu server using Cloudflare for DNS.

When I run ddclient -daemon=0 -debug -verbose -noquiet, I get several error messages, including:

WARNING:  found neither ipv4 nor ipv6 address
DEBUG:    get_ip: using ip, ip reports <undefined>
WARNING:  unable to determine IP address

(Other error messages include warnings about permissions for ddclient.conf, a fatal error about failing to create ddclient.cache, and errors with sendmail, but I feel pretty confident that those are separate issues.)

The relevant section of ddclient.conf is:

##
## CloudFlare (www.cloudflare.com)
##
ssl=yes
protocol=cloudflare,
server=www.cloudflare.com,
login=<my Cloudflare login email>
zone=<mydomain.us>,
password=<API token>
<mydomain.us>,

What can I do to resolve these issues so that ddclient can properly identify my IP address?

Thanks.

@minuzed
Copy link

minuzed commented Nov 17, 2019

I'm not very experienced with this but my guesses would be the following:

WARNING: found neither ipv4 nor ipv6 address
DEBUG: get_ip: using ip, ip reports
WARNING: unable to determine IP address

Check which method ddclient is using to determine the ip-address of your WAN interface. This is determined by the use= statement, which seems to be missing in your config. Personally I use this option to get the ip of my WAN interface:
use=if, if=enp1s0
Change enp1s0 to match your interface. I prefer this since it doesn't rely on any external tools to return the ip-address but instead takes it from the interface itself.

Also, I see a lot of your lines are ending with a comma, which I would remove since I don't think they should be there.

@SpencerDub
Copy link
Author

@minuzed, thanks for the suggestions. I excised the commas and added use=if, if=enp3s0 based on the results of ifconfig.

However, I still get the same results:

WARNING: found neither ipv4 nor ipv6 address
DEBUG: get_ip: using ip, ip reports <undefined>
WARNING: unable to determine IP address

Where should I go from here?

@libertyx82
Copy link

libertyx82 commented Nov 23, 2019

To the reason that your ubuntu server is probably located behind an router, you should use the option use=web, web=checkip.dyndns.org to determine your external IPv4 Address

as example my cloudflare setup

##
## CloudFlare (www.cloudflare.com)
##

# /etc/ddclient.conf
cache=/var/cache/ddclient/ddclient.cache
pid=/var/run/ddclient.pid
daemon=300
syslog=yes
ssl=yes
protocol=cloudflare
ttl=1
use=web
web=checkip.dyndns.org
usev6=if, if=eth0
login=your@mail.com
password=API KEY
zone=your.domain.de
your.host..de

@SpencerDub
Copy link
Author

SpencerDub commented Nov 23, 2019

@libertyx82, thanks for the suggestion. That is correct; my server is set up behind a home router.

I added use=web, web=checkip.dyndns.org to the config file:

##
## CloudFlare (www.cloudflare.com)
##
ssl=yes
protocol=cloudflare
server=www.cloudflare.com
zone=<mydomain.us>
use=web
web=checkip.dyndns.org
login=<myemail@example.com>
password=API KEY
<mydomain.us>

This caused some changes in the error messages:

DEBUG: proxy =
DEBUG: url = checkip.dyndns.org
DEBUG: server = checkip.dyndns.org
CONNECT: checkip.dyndns.org
WARNING: cannot connect to checkip.dyndns.org:80 socket: IO::Socket::INET: Bad hostname 'checkip.dyndns.org'
WARNING: found neither ipv4 nor ipv6 address
DEBUG: get_ip: using web, checkip.dyndns.org reports
WARNING: unable to determine IP address

I'm starting to suspect my firewall has something to do with it. UFW logs show an abundance of items like this (extra items removed):

Nov 12 19:39:44 [...] [UFW BLOCK] IN=enp3s0 OUT= [...] SRC=192.168.0.1 DST=224.0.0.1

My UFW settings look like this:

Status: active
Logging: on (low)
Default: deny (incoming), allow (outgoing), deny (routed)
New profiles: skip
 
To                         Action      From
--                         ------      ----
137,138/udp (Samba)        ALLOW IN    192.168.0.0/16             # allow Samba
139,445/tcp (Samba)        ALLOW IN    192.168.0.0/16             # allow Samba
<SSH port>/tcp             LIMIT IN    Anywhere                   # allow SSH connections
80/tcp                     ALLOW IN    Anywhere                   # allow HTTP
443/tcp                    ALLOW IN    Anywhere                   # allow HTTPS
<SSH port>/tcp (v6)        LIMIT IN    Anywhere (v6)              # allow SSH connections
80/tcp (v6)                ALLOW IN    Anywhere (v6)              # allow HTTP
443/tcp (v6)               ALLOW IN    Anywhere (v6)              # allow HTTPS

Is there something I should add to UFW in order to allow ddclient to function?

@DaveSophoServices
Copy link
Member

DaveSophoServices commented Nov 25, 2019 via email

@SpencerDub
Copy link
Author

SpencerDub commented Nov 25, 2019

@DaveSophoServices, when I access http://checkip.dyndns.org/ from my desktop computer (not my server), it does indeed show my IP.

But ping http://checkip.dyndns.org/ from my server yields:

ping: http://checkip.dyndns.org/: Temporary failure in name resolution

I get the same result from ping checkip.dyndns.org.

@libertyx82
Copy link

libertyx82 commented Nov 25, 2019

What does systemd-resolve --status are showing?

It should look like this

Link 2 (enp0s31f6)
      Current Scopes: DNS
       LLMNR setting: yes
MulticastDNS setting: no
      DNSSEC setting: no
    DNSSEC supported: no
         DNS Servers: 192.168.x.1
                      fd00::464e:ffff:eeee:xxx4
          DNS Domain: fritz.box

@farhank3389
Copy link

Looks like a DNS issue. Are you able to resolve any other names?

@SpencerDub
Copy link
Author

What does systemd-resolve --status are showing?

It should look like this

Link 2 (enp0s31f6)
      Current Scopes: DNS
       LLMNR setting: yes
MulticastDNS setting: no
      DNSSEC setting: no
    DNSSEC supported: no
         DNS Servers: 192.168.x.1
                      fd00::464e:ffff:eeee:xxx4
          DNS Domain: fritz.box

I get this:

Global
          DNSSEC NTA: 10.in-addr.arpa
                      16.172.in-addr.arpa
                      168.192.in-addr.arpa
                      17.172.in-addr.arpa
                      18.172.in-addr.arpa
                      19.172.in-addr.arpa
                      20.172.in-addr.arpa
                      21.172.in-addr.arpa
                      22.172.in-addr.arpa
                      23.172.in-addr.arpa
                      24.172.in-addr.arpa
                      25.172.in-addr.arpa
                      26.172.in-addr.arpa
                      27.172.in-addr.arpa
                      28.172.in-addr.arpa
                      29.172.in-addr.arpa
                      30.172.in-addr.arpa
                      31.172.in-addr.arpa
                      corp
                      d.f.ip6.arpa
                      home
                      internal

Which doesn't look at all similar.

Are you able to resolve any other names?

Pinging google.com and mit.edu both give me the same issue: "Temporary failure in name resolution".

@SpencerDub
Copy link
Author

SpencerDub commented Dec 1, 2019

I looked around and found this resource on opening port 53 via UFW. I added the following UFW rules:

sudo ufw allow 53/tcp comment 'Open port DNS tcp port 53'
sudo ufw allow 53/udp comment 'Open port DNS udp port 53'

After a reboot, this seems to have resolved ddclient's issue with determining the IP address. When I run ddclient -daemon=0 -debug -verbose -noquiet, I'm not getting any errors related to determining IP address. And systemd-resolve --status now includes this entry:

Link 2 (enp3s0)
      Current Scopes: DNS
       LLMNR setting: yes
MulticastDNS setting: no
      DNSSEC setting: no
    DNSSEC supported: no
         DNS Servers: 192.168.0.1
          DNS Domain: lan

@DaveSophoServices
Copy link
Member

DaveSophoServices commented Dec 2, 2019 via email

@AlexBander
Copy link

Hi there,
sorry but i can't confirm.
ddclient version 3.8.3
on run with option use=cmd or usev6=cmd
and cmd-skip option get the following result:

# ddclient -debug -verbose

DEBUG:    get_ip: using cmd, wget -q -O - "http://checkipv6.dyndns.com" | lynx --dump -stdin reports <undefined>
WARNING:  unable to determine IP address

Result run clear on console for the IPv6:
' Current IP Address: xxxx:xx:xxxx:xxxx:xxxx:xxxx:xxx:xxxx' , works

with the same skip option cmd-skip='Current IP Address: '
and IPv4 only use=cmd
of course usev6=cmd => get's an error

DEBUG:    get_ip: using cmd, wget -q -O - "http://checkip.dyndns.com" | lynx --dump -stdin reports xxx.xxx.xxx.xxx
SUCCESS:  ...

and works very well.

Result run clear on console for the IPv4:
' Current IP Address: xxx.xxx.xxx.xxx' - works, too

  • the wget ipv4/ipv6 results are comparable.
  • the clear wget results are the same but on ddclient didn`t ipv6 work
  • use and usev6 didn't change anything on ipv6 request
  • ipv6 tested with many variations off cmd's and web providers|urls but didn't work

@misterjtc
Copy link

misterjtc commented Nov 14, 2020

To the reason that your ubuntu server is probably located behind an router, you should use the option use=web, web=checkip.dyndns.org to determine your external IPv4 Address

as example my cloudflare setup

##
## CloudFlare (www.cloudflare.com)
##

# /etc/ddclient.conf
cache=/var/cache/ddclient/ddclient.cache
pid=/var/run/ddclient.pid
daemon=300
syslog=yes
ssl=yes
protocol=cloudflare
ttl=1
use=web
web=checkip.dyndns.org
usev6=if, if=eth0
login=your@mail.com
password=API KEY
zone=your.domain.de
your.host..de

This worked for me!

Thank you!

@Jayky
Copy link

Jayky commented Mar 23, 2024

Result run clear on console for the IPv4: ' Current IP Address: xxx.xxx.xxx.xxx' - works, too

* the `wget` ipv4/ipv6 results are comparable.

* the clear `wget` results are the same but on ddclient didn`t ipv6 work

* `use` and `usev6` didn't change anything on ipv6 request

* ipv6 tested with many variations off cmd's and web providers|urls but didn't work

I've got the same problem here. Have you found a solution or a workaround meanwhile?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

8 participants