Project was developed to facilitate DNS management in cloudflare through the API provided.
The Cloudflare API exposes the entire Cloudflare infrastructure through a standardized programmatic interface. Using the Cloudflare API, you can do just about anything on cloudflare.com via the client dashboard.
Requirements:
- Cloudflare Token Generate token
- List all Zones
ExCloudflare.list_all_zone()
- Lists all DNS registered in the Zone
ExCloudflare.get_dnsrecord("mydomain.com")
- Create a new DNS in the Zone
ExCloudflare.create_dns_zone("subdomain6.mydomain.com", "CNAME", "google.com", 60, "mydomain.com")
- Update an existing zone
ExCloudflare.update_dns_zone(
%{name: "subdomain1.mydomain.com",
type: "A",
content: "127.0.0.1"
},
"mydomain.com",
%{content: "8.8.8.8",
type: "A",
name: "subdomain1",
ttl: 60,
comment: "My Comment",
proxied: false
}
)
- Delete an existing zone
ExCloudflare.delete_dns_zone(
%{name: "subdomain5.mydomain.com",
type: "A",
content: "127.0.0.1"
}, "mydomain.com"
)
- Download the Image
docker pull dockergpsj/ex_cloudflare:latest
- Start queries on Cloudflare.
docker run -e "API_KEY_CLOUDFLARE=API_TOKEN" -e "FUNCTION=ExCloudflare.get_dnsrecord(\"mydomain.com\")" dockergpsj/ex_cloudflare:latest
Notice that there is a variable named FUNCTION. In this field you put the name of the function you want.