UNPKG

amazon-route-53-dns-zone-file

Version:

Makes DNS Zone File easy. Parses and validates BIND zone files and can be extended for custom features. Functionality is modular. Features are made open for extension and closed for runtime mutation. Written in TypeScript.

253 lines (237 loc) 5.48 kB
export const unsupportedType = ` $ORIGIN igloo.com. www 42s IN DNAME www.otherzone.com. `; export const badDirectiveInclude = ` $ORIGIN igloo.com. $INCLUDE /bin/ls www 42s IN A 1.2.3.4 `; export const badDirectiveUnknown = ` $ORIGIN igloo.com. $EH /bin/ls www 42s IN A 1.2.3.4 `; export const parsingErrorInvalidNesting = ` $ORIGIN igloo.com. $TTL 42s notme NS 1.2.3.4 www IN A 5.6.7.8 NS 9.10.11.12 `; export const empty = ` `; export const tooManyNameArgs = ` eh 42s random text in here TXT canada `; export const txtWithQuotesThatDoNotClose = ` @ TXT "eh "moose" @ NS 1.1.1.1 `; export const txtWithNotEnoughArgs = ` test 42s IN TXT `; export const txtWithNotEnoughArgsOrAnything = ` TXT `; export const txtWithTooManyEntries = ` test 42s IN TXT "multivalued" " txt \"quoted\" record" `; export const txtWithTooManyEntriesNoTtl = ` test IN TXT "multivalued" " txt \"quoted\" record" `; export const txtWithTooManyEntriesNoNameOrTtl = ` TXT "multivalued" " txt \"quoted\" record" `; export const ptrWithTooManyEntries = ` 10.3 45s PTR HOST3.igloo.com. too_many_args_here `; export const ptrWithNotEnoughArgs1 = ` 10.3 45s PTR `; export const aaaaWithTooManyEntries = ` example 42s AAAA ::1 too_many_args_here `; export const aaaaWithNotEnoughArgs1 = ` example 42s AAAA `; export const aWithTooManyEntries = ` example 42s A 127.0.0.1 too_many_args_here `; export const aWithNotEnoughArgs1 = ` example 42s A `; export const spfWithNotEnoughArgs2 = ` test IN SPF `; export const spfWithNotEnoughArgs3 = ` SPF `; export const caaWithTooManyArgs = ` @ CAA 0 iodef "http://iodef.igloo.com/" too_many_args_here `; export const caaWithNotEnoughArgs1 = ` @ CAA 0 iodef `; export const caaWithNotEnoughArgs2 = ` @ CAA 0 `; export const caaWithNotEnoughArgs3 = ` @ CAA `; export const naptrWithTooManyArgs = ` eh 42s IN NAPTR 100 10 "U" "E2U+sip" "!^.*$!sip:customer-service@example.com!" . too_many_args_here `; export const naptrWithNotEnoughArgs1 = ` eh 42s IN NAPTR 100 10 "U" "E2U+sip" "!^.*$!sip:customer-service@example.com!" `; export const naptrWithNotEnoughArgs2 = ` eh 42s IN NAPTR 100 10 "U" "E2U+sip" `; export const naptrWithNotEnoughArgs3 = ` eh 42s IN NAPTR 100 10 "U" `; export const naptrWithNotEnoughArgs4 = ` eh 42s IN NAPTR 100 10 `; export const naptrWithNotEnoughArgs5 = ` eh 42s IN NAPTR 100 `; export const naptrWithNotEnoughArgs6 = ` eh 42s IN NAPTR `; export const naptrWithNotEnoughArgs7 = ` NAPTR `; export const srvWithTooManyArgs = ` *._udp SRV 0 0 0 . too_many_args_here `; export const srvWithNotEnoughArgs1 = ` *._udp SRV 0 0 0 `; export const srvWithNotEnoughArgs2 = ` *._udp SRV 0 0 `; export const srvWithNotEnoughArgs3 = ` *._udp SRV 0 `; export const srvWithNotEnoughArgs4 = ` *._udp SRV `; export const srvWithNotEnoughArgs5 = ` SRV `; export const nsWithTooManyArgs = ` @ NS NS2.NAMESERVER.NET. too_many_args_here `; export const nsWithNotEnoughArgs1 = ` @ NS `; export const nsWithNotEnoughArgs2 = ` @ 42s NS `; export const nsWithNotEnoughArgs3 = ` NS `; export const nsWithNotEnoughArgs4 = ` IN NS `; export const mxWithTooManyArgs = ` @ MX 0 mail1 too_many_args_here `; export const mxWithNotEnoughArgs1 = ` @ MX 0 `; export const mxWithNotEnoughArgs2 = ` @ MX `; export const cnameWithTooManyArgs = ` mail1 CNAME mail too_many_args_here `; export const cnameWithNotEnoughArgs1 = ` mail1 CNAME `; export const cnameWithNotEnoughArgs2 = ` CNAME `; export const simpleSoa = ` @ IN SOA eh( 11 2 33 4 55 ) `; export const invalidSoaParensNewLine = ` @ IN SOA example.ns.net ( invalid ) `; export const invalidSoaNested = ` @ IN SOA example.ns.net ( (invalid) 1406291485 3600 600 604800 42s ) `; export const invalidSoaParensNotClosed = ` @ IN SOA example.ns.net ( invalid @ NS 1.1.1.1 `; export const invalidSoaClosedWithoutOpening = ` @ IN SOA example.ns.net ( invalid @ NS 1.1.1.1 `; export const incompleteRecords = ` www.igloo.com. 160 IN `; export const mixOfBadRecords = ` $TTL -6 test 42s IN TXT "multivalued" " txt \"quoted\" record" test IN TXT "multivalued" " txt \"quoted\" record" 10.3 45s PTR HOST3.igloo.com. too_many_args_here test IN SPF "v=spf1" "mx:gcloud-node.com." "-all" too_many_args_here @ CAA 0 iodef "http://iodef.igloo.com/" too_many_args_here eh 42s IN NAPTR 100 10 "U" "E2U+sip" "!^.*$!sip:customer-service@example.com!" . too_many_args_here *._udp SRV 0 0 0 . too_many_args_here *._udp SRV 0 @ NS NS2.NAMESERVER.NET. too_many_args_here @ MX 0 mail1 too_many_args_here mail1 CNAME mail too_many_args_here @ SOA server.igloo.com. hostmainline.igloo.com. ( 1995032001 3600 3600 604800 42s ) NS server.igloo.com. `; export const onlyComment = ` ; nothing `; export const duplicateRecord = ` $TTL 42s neither A 1.2.3.4 A 1.2.3.4 `; export const ignoredRecords = ` @ IN SOA ns.igloo.com. username.igloo.com. ( 2007120710 ; serial number of this zone file 1d ; secondary refresh (1 day) 2h ; secondary retry time in case of a problem (2 hours) 4w ; secondary expiration time (4 weeks) 1h ; maximum caching time in case of failed lookups (1 hour) ) @ NS NS1.NAMESERVER.NET. `; export const badTtl = ` $TTL ZZZ eh A ???.?? 1.2.3.4 `; export const tooManyValueArgs = ` eh 42s IN NAPTR 100 200 300 400 500 600 700 800 900 1000 `;