aboutsummaryrefslogtreecommitdiff
path: root/lib/dns/testdata/zone
AgeCommit message (Collapse)Author
2026-01-15all: convert license and copyright to use SPDX identifiersShulhan
With help of spdxconv tool [1], we able to bulk update all files license and copyright format to comply with SPDX formats. [1] https://kilabit.info/project/spdxconv/
2023-08-06lib/dns: use Zone as single source of truth when parsingShulhan
Previously, the zoneParser store its own origin and TTL, which make it duplicates and confuse with the zone field that stored and returned by parser. To make things simple, use the zone field value as single source of truth for origin (using zone.Origin) and TTL (using zone.SOA.Minimum).
2023-08-06lib/dns: make sure that the zone Origin always end with periodShulhan
One of the property that we seems forget that the Origin actually must be absolute domain, end with period. If user does not know this, they may call NewZone or define $ORIGIN in zone file with relative domain.
2023-08-05lib/dns: always initialize the Zone SOA record to default valuesShulhan
Previously, if we parse, create, or remove the SOA record from zone, we assume the SOA records are valid and not touch their values. In this changes, we set the SOA fields to default values if its not set, to make the SOA record consistent and valid, in perspective of client. This changes also export the default OS values for documentation and add new method NewRDataSOA to simplify creating new SOA record.
2023-05-18lib/dns: fix zone parsing on SOA record with single lineShulhan
Due to refactoring in c376eccd25, parsing SOA record with single line return an error: "parseSOA: line 2: incomplete SOA statement '0'".
2023-04-04lib/bytes: changes the DumpPrettyTable output formatShulhan
The change is to accommodate large bytes data, more than 0xFFFF. The hex address in the first column is increased to 8 digits, the characters compacted without space in between.
2023-03-26lib/dns: fix packing, parsing, and saving MINFO resource dataShulhan
Even thought the MINFO record not formally obsolete, according to Wikipedia [1], we still need to support this for backward compatibility. When packing the resource data length does not include total length. When parsing, the RMailBox and EmailBox should be added the origin suffix if its not end with dot. When saving, the origin should be trimmed from RMailBox and EmailBox. [1] https://en.wikipedia.org/wiki/List_of_DNS_record_types#Obsolete_record_types
2023-03-26lib/dns: fix packing and unpacking resource record HINFOShulhan
The rdata for HINFO contains two character-strings: CPU and OS. Previously, we pack the rdata section sequentially, without adding length on each of them: <RDLEN><CPU><OS>. The correct pack format should <RDLEN><LENGTH><CPU><LENGTH><OS>.
2023-03-25lib/dns: fix parsing SRV record from zone fileShulhan
Previous parseSRV start by parsing the _Service from tok, but the actual value of parameter tok is the Priority. This changes fix this and as testing we use the example from RFC 2782.
2023-03-25lib/dns: allow parsing TXT rdata without quote in zone fileShulhan
Previously, the zone only parsing TXT record with double quote since most of the example that we found during implementation all use double quote. This changes allow non-double quoted text in zone file with consequence that any spaces will terminated the rdata immediately. Fixes #6
2023-03-23lib/dns: handle zone file with CRLF line endingShulhan
While at it, fix parsing multiline SOA record where closing parentheses end on next lines. Fixes #6
2023-03-23lib/dns: add function ParseZoneShulhan
The ParseZone parse the content of zone from raw bytes. Now that we have ParseZone, all tests that use zoneParser now can be replaced using combination of test.Data and ParseZone.