{"id":19608927,"url":"https://github.com/fire1ce/pihole-cloudflare-dns-sync","last_synced_at":"2025-07-05T14:39:01.397Z","repository":{"id":48413813,"uuid":"516873390","full_name":"fire1ce/pihole-cloudflare-dns-sync","owner":"fire1ce","description":"Lightweight Container to be used in conjunction with a Pi-hole instance to sync the DNS records of Cloudflare DNS to Pi-hole local DNS.","archived":false,"fork":false,"pushed_at":"2023-10-17T22:37:50.000Z","size":115,"stargazers_count":3,"open_issues_count":7,"forks_count":1,"subscribers_count":2,"default_branch":"main","last_synced_at":"2024-05-02T03:09:28.323Z","etag":null,"topics":["cloudflare","cloudflare-dns","container","pi-hole","pihole","sync"],"latest_commit_sha":null,"homepage":"https://3os.org","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/fire1ce.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":".github/FUNDING.yml","license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null},"funding":{"github":"fire1ce","patreon":"fire1ce","custom":["https://www.paypal.com/donate/?hosted_button_id=Y5NSXQQ6VPSK6\u0026Z3JncnB0","https://www.buymeacoffee.com/fire1ce"]}},"created_at":"2022-07-22T20:04:18.000Z","updated_at":"2024-03-11T15:02:42.000Z","dependencies_parsed_at":"2023-02-16T14:15:32.733Z","dependency_job_id":null,"html_url":"https://github.com/fire1ce/pihole-cloudflare-dns-sync","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fire1ce%2Fpihole-cloudflare-dns-sync","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fire1ce%2Fpihole-cloudflare-dns-sync/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fire1ce%2Fpihole-cloudflare-dns-sync/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fire1ce%2Fpihole-cloudflare-dns-sync/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/fire1ce","download_url":"https://codeload.github.com/fire1ce/pihole-cloudflare-dns-sync/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":224083630,"owners_count":17252899,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["cloudflare","cloudflare-dns","container","pi-hole","pihole","sync"],"created_at":"2024-11-11T10:18:36.714Z","updated_at":"2024-11-11T10:18:37.836Z","avatar_url":"https://github.com/fire1ce.png","language":"Python","funding_links":["https://github.com/sponsors/fire1ce","https://patreon.com/fire1ce","https://www.paypal.com/donate/?hosted_button_id=Y5NSXQQ6VPSK6\u0026Z3JncnB0","https://www.buymeacoffee.com/fire1ce"],"categories":[],"sub_categories":[],"readme":"# pihole-cloudflare-dns-sync\n\n[![Build](https://github.com/fire1ce/pihole-cloudflare-dns-sync/actions/workflows/ci.yml/badge.svg)](https://github.com/fire1ce/pihole-cloudflare-dns-sync/actions/workflows/ci.yml) [![License: GPL v3](https://img.shields.io/badge/License-GPLv3-blue.svg)](https://www.gnu.org/licenses/gpl-3.0) [![Docker Pulls](https://img.shields.io/docker/pulls/fire1ce/pihole-cloudflare-dns-sync.svg)](https://hub.docker.com/r/fire1ce/pihole-cloudflare-dns-sync) [![Docker Stars](https://img.shields.io/docker/stars/fire1ce/pihole-cloudflare-dns-sync.svg)](https://hub.docker.com/r/fire1ce/pihole-cloudflare-dns-sync) [![https://3os.org](https://img.shields.io/badge/Follow-https%3A%2F%2F3os.org-orange)](https://3os.org) [![Contribution is Welcome](https://img.shields.io/badge/Contribution%20Is-Welcomed-brightgreen)](https://github.com/fire1ce/pihole-cloudflare-dns-sync)\n\n## Description\n\nLightweight Container image based on [python:3.9.13-alpine][docker-hub-python-url] to be used in conjunction with a [Pi-hole][pi-hole-net-url] instance to sync the DNS records from [Cloudflare DNS Service][cloudflare-url] to **Pi-hole local DNS**.\n\n### Supports\n\n- A records\n- CNAME records\n- Any type of Pi-hole instance\n\n## Requirements\n\n- Cloudflare API Readonly Token\n- Pi-hole instance\n\n### Creating a Cloudflare API token\n\nTo create a CloudFlare API token for your DNS zone go to [https://dash.cloudflare.com/profile/api-tokens][cloudflare-api-token-url] and follow these steps:\n\n1. Click Create Token\n2. Select Create Custom Token\n3. Provide the token a name, for example, `example.com-dns-zone-readonly`\n4. Grant the token the following permissions:\n   - Zone - DNS - Read\n5. Set the zone resources to:\n   - Include - Specific Zone - `example.com`\n6. Complete the wizard and use the generated token at the `CLOUDFLARE_API_TOKEN` variable for the container\n\n## Parameters\n\n| Parameter               | Description             | Default         | Type    | Required |\n| ----------------------- | ----------------------- | --------------- | ------- | -------- |\n| CLOUDFLARE_API_TOKEN    | Cloudflare API Token    | change_me       | string  | Yes      |\n| CLOUDFLARE_DOMAIN       | Cloudflare Domain       | example.com     | string  | Yes      |\n| EXCLUDE_PROXIED_RECORDS | Exclude Proxied Records | yes             | string  | Yes      |\n| PIHOLE_HOST             | Pi-hole hostname/IP     | 123.123.123.123 | string  | Yes      |\n| PIHOLE_PORT             | Pi-hole port            | 80              | integer | Yes      |\n| USE_HTTPS               | http/https for pihole   | no              | string  | Yes      |\n| PIHOLE_PASSWORD         | Pi-hole password        | change_me       | string  | Yes      |\n| RUN_EVERY               | Run very x minute       | 5               | integer | Yes      |\n\n## Usage\n\nDocker run example:\n\n```shell\ndocker run -d \\\n  --name pihole-cloudflare-dns-sync \\\n  -h pihole-cloudflare-dns-sync \\\n  --restart always \\\n  -v /etc/timezone:/etc/timezone:ro \\\n  -v /etc/localtime:/etc/localtime:ro \\\n  -e CLOUDFLARE_API_TOKEN=cloudflare_secret_dns_zone_api_token \\\n  -e CLOUDFLARE_DOMAIN=example.com \\\n  -e EXCLUDE_PROXIED_RECORDS=yes \\\n  -e PIHOLE_HOST=123.123.123.123 \\\n  -e PIHOLE_PORT=80 \\\n  -e USE_HTTPS=no \\\n  -e PIHOLE_PASSWORD=secret \\\n  -e RUN_EVERY=1 \\\n  -e PUID=1000 \\\n  -e PGID=1000 \\\nfire1ce/pihole-cloudflare-dns-sync\n```\n\nDocker compose example:\n\n```yml\nversion: '3'\n\nservices:\n  pihole-cloudflare-dns-sync:\n    image: fire1ce/pihole-cloudflare-dns-sync\n    container_name: pihole-cloudflare-dns-sync\n    hostname: pihole-cloudflare-dns-sync\n    restart: always\n    network_mode: bridge\n    volumes:\n      - /etc/timezone:/etc/timezone:ro\n      - /etc/localtime:/etc/localtime:ro\n    environment:\n      - CLOUDFLARE_API_TOKEN=cloudflare_secret_dns_zone_api_token\n      - CLOUDFLARE_DOMAIN=example.com\n      - EXCLUDE_PROXIED_RECORDS=yes\n      - PIHOLE_HOST=123.123.123.123\n      - PIHOLE_PORT=80\n      - USE_HTTPS=no\n      - PIHOLE_PASSWORD=secret\n      - RUN_EVERY=1\n      - PUID=1000\n      - PGID=1000\n```\n\n## License\n\nThis project is licensed under the **GNU General Public License v3.0** - see the [LICENSE][license-url] file for details\n\n\u003c!-- appendices --\u003e\n\n\u003c!-- urls --\u003e\n\n[pi-hole-net-url]: https://pi-hole.net/ 'Pi-hole Website'\n[cloudflare-url]: https://www.cloudflare.com/ 'Cloudflare Website'\n[cloudflare-api-token-url]: https://dash.cloudflare.com/profile/api-tokens 'Cloudflare API Token'\n[docker-hub-python-url]: https://hub.docker.com/_/python?tab=tags 'Docker Hub Python'\n[license-url]: https://github.com/fire1ce/pihole-cloudflare-dns-sync/blob/main/LICENSE.md 'LICENSE'\n\n\u003c!-- end appendices --\u003e\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffire1ce%2Fpihole-cloudflare-dns-sync","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ffire1ce%2Fpihole-cloudflare-dns-sync","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffire1ce%2Fpihole-cloudflare-dns-sync/lists"}