Reply

WAPI create large TXT record

KBush
Techie
Posts: 6
4263     0

To keep things short and sweet, is there a way you can you create a TXT Record through the WAPI with text greater than 255 bytes? I have tried a few things with no luck. Here is what documentation suggests:

"Text associated with the record. It can contain up to 255 bytes per substring, up to a total of 512 bytes"

Here is what my curl request looks like when creating the txt record:

curl -k -u admin:infoblox -H "Content-Type: application/json" -X POST https://10.10.30.100/wapi/v1.4.2/record:txt -d '{

"name": "mytxtrecord.domain.com",
"text": "v=DKIM1;k=rsa;p=MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEA9x2BTzs5hCrx2CR1sX9pHxFKFo1VR/ivJ6...",
"ttl": 28800,
"view": "internal"

}'

Any help would be much appreciated! Thanks

How to use substrings to create a large TXT record

Adviser
Posts: 132
4264     0

After some experimentation I was able to create a TXT record with text larger than 255 characters. The trick is that you have to express the substrings as quoted strings within the overall text string passed as the "text" value, for example as follows:

{"name": "text.example.com", "text": "\"A text string\"\"Another text string\""}

This causes the resulting TXT record value to be as follows (as displayed by the dig utility, for example):

"A text string" "Another text string"

Here's a test I did to create a longer TXT value using two 255-character substrings:

curl --tlsv1 --user 'admin:infoblox' --header 'Content-Type: application/json' --data '{"name": "test.example.com", "text": "\"123456789a123456789b123456789c123456789d123456789e123456789f123456789g123456789h123456789i123456789j123456789k123456789l123456789m123456789n123456789o123456789p123456789q123456789r123456789s123456789t123456789u123456789v123456789w123456789x123456789y12345\"\"123456789A123456789B123456789C123456789D123456789E123456789F123456789G123456789H123456789I123456789J123456789K123456789L123456789M123456789N123456789O123456789P123456789Q123456789R123456789S123456789T123456789U123456789V123456789W123456789X123456789Y12345\""}' 'https://gm.example.com/wapi/v1.0/record:txt'

If I query for the resulting TXT record using the dig utility I get the following output:

dig test.example.com txt
;; Truncated, retrying in TCP mode.

; <<>> DiG 9.8.3-P1 <<>> test.example.com txt
;; global options: +cmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 62217
;; flags: qr aa rd ra; QUERY: 1, ANSWER: 1, AUTHORITY: 2, ADDITIONAL: 2

;; QUESTION SECTION:
;test.example.com.        IN    TXT

;; ANSWER SECTION:
test.example.com.    28800    IN    TXT    "123456789a123456789b123456789c123456789d123456789e123456789f123456789g123456789h123456789i123456789j123456789k123456789l123456789m123456789n123456789o123456789p123456789q123456789r123456789s123456789t123456789u123456789v123456789w123456789x123456789y12345" "123456789A123456789B123456789C123456789D123456789E123456789F123456789G123456789H123456789I123456789J123456789K123456789L123456789M123456789N123456789O123456789P123456789Q123456789R123456789S123456789T123456789U123456789V123456789W123456789X123456789Y12345"

;; AUTHORITY SECTION:
...

Note again that the TXT value consists of two separately-quoted substrings. A DNS client querying for the TXT record would have to have the intelligence to concatenate the substrings together to form the resulting long string.

Thank you Frank for the quick

KBush
Techie
Posts: 6
4264     0

Thank you Frank for the quick response, this is exactly what I was looking for.

Showing results for 
Search instead for 
Do you mean 

Recommended for You