Giter Site home page Giter Site logo

Comments (2)

mahtin avatar mahtin commented on July 23, 2024

The proxied parameter for dns_records can be set to true or false. Here's some examples which show when it can be used.

Pardon the redacted zone name; but first set the zone name:

$ ZONE="██████████████████.com"
$

Creating a simple A record; notice the proxiable value is `true. This is key to understand.

$ cli4 --post name="example-0" type="A" content="52.52.1.1" /zones/:${ZONE}/dns_records
{
    ...
    "name": "example-0.██████████████████.com",
    "proxiable": true,
    "proxied": false,
    ...
}
$

If we do the same; but with a private IP space A record. Notice the proxiable value is false.

$ cli4 --post name="example-1" type="A" content="192.168.1.1" proxied=false /zones/:${ZONE}/dns_records
{
    ...
    "name": "example-1.██████████████████.com",
    "proxiable": false,
    "proxied": false,
    ...
}
$

This is becuase you can't proxy into a private IP space address.

We can see an error, if we try to set the proxied flag to true

$ cli4 --post name="example-2" type="A" content="192.168.1.1" proxied=true /zones/:${ZONE}/dns_records
cli4: /zones/:██████████████████.com/dns_records - 1004 DNS Validation Error
$

This is the error you maybe seeing.

Here is a successful use of the proxied` flag.

$ cli4 --post name="example-2" type="A" content="52.52.1.1" proxied=true /zones/:${ZONE}/dns_records
{   
    ...
    "name": "example-2.██████████████████.com",
    "proxiable": true,
    "proxied": true,
    ...
}
$

While these are written with the cli4 command; it's the same affect as calling the Python library.

from python-cloudflare.

incoming-th avatar incoming-th commented on July 23, 2024

The proxied parameter for dns_records can be set to true or false. Here's some examples which show when it can be used.

Pardon the redacted zone name; but first set the zone name:

$ ZONE="██████████████████.com"
$

Creating a simple A record; notice the proxiable value is `true. This is key to understand.

$ cli4 --post name="example-0" type="A" content="52.52.1.1" /zones/:${ZONE}/dns_records
{
    ...
    "name": "example-0.██████████████████.com",
    "proxiable": true,
    "proxied": false,
    ...
}
$

If we do the same; but with a private IP space A record. Notice the proxiable value is false.

$ cli4 --post name="example-1" type="A" content="192.168.1.1" proxied=false /zones/:${ZONE}/dns_records
{
    ...
    "name": "example-1.██████████████████.com",
    "proxiable": false,
    "proxied": false,
    ...
}
$

This is becuase you can't proxy into a private IP space address.

We can see an error, if we try to set the proxied flag to true

$ cli4 --post name="example-2" type="A" content="192.168.1.1" proxied=true /zones/:${ZONE}/dns_records
cli4: /zones/:██████████████████.com/dns_records - 1004 DNS Validation Error
$

This is the error you maybe seeing.

Here is a successful use of the proxied` flag.

$ cli4 --post name="example-2" type="A" content="52.52.1.1" proxied=true /zones/:${ZONE}/dns_records
{   
    ...
    "name": "example-2.██████████████████.com",
    "proxiable": true,
    "proxied": true,
    ...
}
$

While these are written with the cli4 command; it's the same affect as calling the Python library.

I just wasted 3 hours of testing because I tried to do just that from the example on the CF API "198.51.100.4" and "192.168.0.1":

This is because you can't proxy into a private IP space address.

Just this sentence saved me from my headaches, and after reading it I was like "Yeah make sense".

So thanks for it, but I believe this should have been helpful to got it from the doc or from the error message instead of the general "CloudFlare.exceptions.CloudFlareAPIError: DNS Validation Error"

from python-cloudflare.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.