oznu / docker-cloudflare-ddns

A small amd64/ARM/ARM64 Docker image that allows you to use CloudFlare as a DDNS / DynDNS Provider.
https://hub.docker.com/r/oznu/cloudflare-ddns/
GNU General Public License v3.0
1.07k stars 213 forks source link

could not resolve host: api.cloudflare.com #47

Closed fogx closed 3 years ago

fogx commented 4 years ago

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[bot] commented 3 years ago

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.

harveydobson commented 3 years ago

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
jwillmer commented 3 years ago

Came across the same issue. Anyone could fix it?

adamaltmejd commented 3 years ago

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
adamaltmejd commented 3 years ago

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
ethanlevine commented 3 years ago

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.

Jameshudson commented 3 years ago

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.

mdesson commented 2 years ago

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

kdpuvvadi commented 2 years ago

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

jig1056 commented 2 years ago

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