octodns / octodns-cloudflare

Cloudflare DNS provider for octoDNS
MIT License
24 stars 18 forks source link

Not able to create a TXT record that contains Double quotes #115

Open maltsaar opened 2 days ago

maltsaar commented 2 days ago

Is there any way to create a TXT record that contains Double quotes?

  - ttl: 120
    type: TXT
    value: Hello world

and

  - ttl: 120
    type: TXT
    value: '"Hello world"'

both result in:

Image

  - ttl: 120
    type: TXT
    value: \"Hello world\"

results in:

Image

How do I get the following result?

Image

ross commented 1 day ago

As far as I can tell it's not possible to create a unquoted TXT value in CF. If I enter "Hello World" in the UI:

Image

and dig gives me:


; <<>> DiG 9.10.6 <<>> TXT _digme.xormedia.com. @ben.ns.cloudflare.com.
;; global options: +cmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 2464
;; flags: qr aa rd; QUERY: 1, ANSWER: 1, AUTHORITY: 0, ADDITIONAL: 1
;; WARNING: recursion requested but not available

;; OPT PSEUDOSECTION:
; EDNS: version: 0, flags:; udp: 1232
;; QUESTION SECTION:
;_digme.xormedia.com.       IN  TXT

;; ANSWER SECTION:
_digme.xormedia.com.    300 IN  TXT "Hello World"

;; Query time: 10 msec
;; SERVER: 108.162.193.103#53(108.162.193.103)
;; WHEN: Wed Nov 20 13:45:05 PST 2024
;; MSG SIZE  rcvd: 72

If I enter Hello World, no quotes, in the UI it adds the quotes back once saved:

Image

and dig returns the same (quoted) thing.

In both cases the API returns the string quoted:

['_digme',
 {'octodns': {'cloudflare': {'auto-ttl': True}},
  'ttl': 500,
  'type': 'TXT',
  'value': '"Hello World"'}]

All of this matches the behavior of octoDNS's YamlProvider, which effectively treats Hello World and "Hello World" the same.