diff --git a/examples/dns/record.py b/examples/dns/record.py new file mode 100644 index 00000000000..2c1c2ae9470 --- /dev/null +++ b/examples/dns/record.py @@ -0,0 +1,26 @@ +from cloudflare import Cloudflare + + +# define your variable here + +cloudflare_token = "your-cloudflare-token" +cloudflare_zone_id = "zone" +alias_name = "www.mydns.com" +cannonical_name = "cname.example.com" + +# build cloudflare driver here +client = Cloudflare(api_token=cloudflare_token) + + + +# create dns using defined driver +dns = client.dns.records.create( + zone_id=cloudflare_zone_id, + type='CNAME', + name=alias_name, + content=cannonical_name, + proxied=False + ) + +# print output +print(dns) \ No newline at end of file