oznu/docker-cloudflare-ddns

could not resolve host: api.cloudflare.com

fogx opened this issue ยท 10 comments

fogx commented

Hi,
i'm trying to set up the cf-ddns, but i get the following error message:

cf-ddns | curl: (6) Could not resolve host: api.cloudflare.com
cf-ddns | ----------------------------------------------------------------
cf-ddns | ERROR: Invalid CloudFlare Credentials - 000
cf-ddns | ----------------------------------------------------------------
cf-ddns | Make sure the API_KEY is correct.

docker-compose:

  cf-ddns:
    container_name: cf-ddns
    image: oznu/cloudflare-ddns:latest
    restart: unless-stopped
    environment:
      - API_KEY=$CLOUDFLARE_ZONE_API_TOKEN
      - ZONE=$DOMAINNAME_DEV
      - PROXIED=true
      - RRTYPE=A
      - DELETE_ON_STOP=false
      - DNS_SERVER=1.1.1.1

i've followed the tutorial and created the zone api token, then added that to the .env file. Any ideas as to why i could be getting this error? I can ping the url from my server

stale commented

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

I have the same issue.

version: '2'
services:
  cloudflare-ddns:
    image: oznu/cloudflare-ddns:latest
    restart: always
    environment:
      - API_KEY=xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
      - ZONE=xxx.co.uk
      - SUBDOMAIN=xxsubdomain
      - PROXIED=true

Came across the same issue. Anyone could fix it?

The same issue just started showing up on one of my servers. All other containers work but DNS resolution fails for this one. Might be related to this? https://gitlab.alpinelinux.org/alpine/aports/-/issues/12091 Because I can run

docker run --rm alpine:3.12 ping 8.8.8.8

but not

docker run --rm alpine:3.13 ping 8.8.8.8

Here is the solution, at least for me: https://docs.linuxserver.io/faq#libseccomp. Run (on host):

wget http://ftp.us.debian.org/debian/pool/main/libs/libseccomp/libseccomp2_2.5.1-1_armhf.deb
sudo dpkg -i libseccomp2_2.5.1-1_armhf.deb

Recently started experiencing this issue as well. nslookup api.cloudflare.com 1.1.1.1 returns ipv6 and ipv4 records from other devices on the same home network. Double-checked that api key has proper privs and is not expired.

Has anyone had any luck with this one? I just started getting this issue randomly. Nothing on my end changed as far as I can tell.

My docker-compose is pretty much the same as @harveydobson's expect I have PROXIED=false.

Would it be possible to reopen this issue? It suddenly started happening for me this afternoon

If anyone still facing the issue, it's DNS. It always the DNS. set dns to cloudflare or google dns. something

dns:
      - 127.0.0.1
      - 1.1.1.1

your Compose file should look something like this

version: '2'
services:
  cloudflare-ddns:
    image: oznu/cloudflare-ddns:latest
    restart: always
    environment:
      - API_KEY=xxxxxxx
      - ZONE=example.com
      - SUBDOMAIN=subdomain
      - PROXIED=false
    dns:
      - 127.0.0.1
      - 1.1.1.1

it's always the DNS

hi @kdpuvvadi thanks a lot. That worked for me.