namedmanager icon indicating copy to clipboard operation
namedmanager copied to clipboard

Truncation of TXT entry

Open gtrimmel opened this issue 9 years ago • 4 comments

Hi! I need to set some TXT records (mostly for DKIM) but the entries don't make it to the zonefile. For example when i set following entry in the Webinterface: TXT 1800 test "v=DKIM1; k=rsa; p=MIZfKK0GCSqGSIb3DQEBAQUAA4G3456bbbAAALLL1KIwFUUU1lLdeo9rtSEQpAPPPqBQ1QIGf9hoL0c999988887777aaaaLvM6h+kjFFCsAKgCprVkzme/SSSSKN5v6ioz0ywJt8SGX7n0JgW+JiHcXfN84qXwAvrpfYqn8IDj1xUGDuiuoMjfbLiaaageXaoYo3Uq7pAikjSfokwIDAQAB" the entry in the zonefile is truncated and looks like this: test 1800 IN TXT whereas the entry is correctly displayed in the webinterface. Is there a certain limitation in the field lenght or something like that? It would be great, if i could set those entries via namedmanager, as i'm pretty happy with it otherwise!

Thanks! Günter Trimmel

gtrimmel avatar Dec 16 '15 10:12 gtrimmel

hi Günter,

There should be no limitations on string length that would result in it missing from the bind configuration file... the entry definitely still appears in the web UI after saving and reloading the page?

regards, Jethro

jethrocarr avatar Jan 19 '16 10:01 jethrocarr

Hi Jethro,

Yes, the entry definitely appears in the web UI - even after reloading the page, logging out and back in and so forth! One thing to note is, that the domainname/Hostname entry starts with an underscore. Yeah, i know this is said to be a an illegal character per RFC 952 and 1123, but per RFC 2872 it is definitely allowed when used at the beginning of a field and needed for Domainkeys/DKIM SRV and/or TXT entries - see: http://domainkeys.sourceforge.net/underscore.html). Maybe that's the problem here? OTOH the entries make it to the zone file (even with the underscores in the domainname fields!) when i shorten the entry data to about 40 characters or thereabouts!? Is there anything i can look into or try in order to debug this?

Best Regards, Günter

gtrimmel avatar Jan 19 '16 10:01 gtrimmel

I ran into the same problem. The Domainkeys record is longer than 255 bytes, and I have to split it into multiple text string. Ref: https://forums.aws.amazon.com/thread.jspa?threadID=93940

When I imported and ran the route53's cron for the first time, It was truncated. I tried to change it in namedmanager and resubmitted it, I got this on the log file:

PHP Fatal error: Uncaught exception 'Guzzle\Service\Exception\ValidationException' with message 'Validation errors: [ChangeBatch][Changes][3][Change][ResourceRecordSet]PHP Fatal error: Uncaught exception 'Guzzle\Service\Exception\ValidationException' with message 'Validation errors: [ChangeBatch][Changes][3][Change][ResourceRecordSet][ResourceRecords][0][ResourceRecord][Value] must be of type string' in >/home/namedmanager/htdocs/include/vendor/aws-sdk/Guzzle/Service/Command/AbstractCommand.php:358 Stack trace: #0 /home/namedmanager/htdocs/include/vendor/aws-sdk/Guzzle/Service/Command/AbstractCommand.php(237): Guzzle\Service\Command\AbstractCommand->validate() #1 /home/namedmanager/htdocs/include/vendor/aws-sdk/Guzzle/Service/Client.php(200): Guzzle\Service\Command\AbstractCommand->prepare() #2 /home/namedmanager/htdocs/include/vendor/aws-sdk/Guzzle/Service/Client.php(135): Guzzle\Service\Client->prepareCommand(Object(Guzzle\Service\Command\OperationCommand)) #3 /home/namedmanager/htdocs/include/vendor/aws-sdk/Guzzle/Service/Command/AbstractCommand.php(154): Guzzle\Service\Client->execute(Object(Guzzle\Service\Command\OperationCommand)) #4 /home/name in /home/dnsweb/namedmanager/htdocs/include/vendor/aws-sdk/Guzzle/Service/Command/AbstractCommand.php on line 358`

I dumped the var and got this:

[Changes] => Array
    (
        [0] => Array
            (
                [Action] => DELETE
                [ResourceRecordSet] => Array
                    (
                        [Name] => mydomain.com.
                        [Type] => SOA
                        [TTL] => 900
                        [ResourceRecords] => Array
                            (
                                [0] => Array
                                    (
                                        [Value] => ns-862.awsdns-43.net. sysadmin.mydomain.com. 2016102308 7200 900 1209600 86400
                                    )
                            )
                    )
            )

        [1] => Array
            (
                [Action] => CREATE
                [ResourceRecordSet] => Array
                    (
                        [Name] => mydomain.com.
                        [Type] => SOA
                        [TTL] => 900
                        [ResourceRecords] => Array
                            (
                                [0] => Array
                                    (
                                        [Value] => ns-862.awsdns-43.net. sysadmin.mydomain.com. 2016102310 7200 900 1209600 86400
                                    )
                            )
                    )
            )

        [2] => Array
            (
                [Action] => DELETE
                [ResourceRecordSet] => Array
                    (
                        [Name] => google._domainkey.mydomain.com.
                        [Type] => TXT
                        [TTL] => 3600
                        [ResourceRecords] => Array
                            (
                                [0] => Array
                                    (
                                        [Value] => "v=DKIM1"
                                    )
                            )
                    )
            )

        [3] => Array
            (
                [Action] => CREATE
                [ResourceRecordSet] => Array
                    (
                        [Name] => google._domainkey.mydomain.com.
                        [Type] => TXT
                        [TTL] => 3600
                        [ResourceRecords] => Array
                            (
                                [0] => Array
                                    (
                                        [Value] =>
                                    )
                            )
                    )
            )
    )

)

I have no idea why Array[3][ResourceRecords][0][Value] is empty. The actual value on Namedmanager is

"v=DKIM1; k=rsa; p=MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQDI0AZ5lkxfaH+rLvn3+03cao1fRpH+EnX/dvTf+winzYYbWcWErXxYNfhX6r" "/jsFiCCPRS5YEWk6jmxDVbHzrjJZ+7Lzb5NuydMi0mASN1oC+by7HxocZnwj4527AQDSqCZPT6R4USGMR8krqoYVquFhvJw59tfwY7NY0CzFZAywIDAQAB"

pmquan avatar Oct 24 '16 18:10 pmquan

More information:

Array ( [0] => 256 [id_record] => 256 [1] => google._domainkey [name] => google._domainkey [2] => TXT [type] => TXT [3] => "v=DKIM1; k=rsa; p=MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQDI0AZ5lkxfaH+rLvn3+03cao1fRpH+EnX/dvTf+winzYYbWcWErXxYNfhX6r /jsFiCCPRS5YEWk6jmxDVbHzrjJZ+7Lzb5NuydMi0mASN1oC+by7HxocZnwj4527AQDSqCZPT6R4USGMR8krqoYVquFhvJw59tfwY7NY0CzFZAywIDAQAB" [content] => [4] => 600 [ttl] => 600 [5] => 0 [prio] => 0 )

There is no content for this object but in htdocs/include/application/inc_cloud_route53.php line 422 asked for this data :)

pmquan avatar Oct 24 '16 19:10 pmquan