| Age | Commit message (Collapse) | Author |
|
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/
|
|
Previously, we unpack the header and then question without
detecting whether the header itself is valid or not, for
example the op-code, the response code.
This cause the unpacking question return an error like
label length overflow at index xxx
One of the case is when someone sent random or HTTP request
to DoT port.
|
|
Instead of passing the whole packet, pass the packet for unpacking
target name only and rdata for unpacking the SVCB HTTPS record.
|
|
The RDATA in OPT records can contains zero or _more_ options.
Previously, we only handle unpacking and packing one option, now we
handle multiple options.
|
|
Somehow the test passed on my main machine, but failed on my laptop.
Weird.
|
|
|
|
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).
|
|
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.
|
|
The AddAuthority add the rr to list of Authority.
Calling this method mark the message as answer, instead of query.
If the rr is SOA, it will replace the existing record if exist and set
the flag authoritative answer (IsAA) in header to true.
If the rr is NS, it will be added only if its not exist.
It will return an error if the rr type is not SOA or NS or the size of
records in Authority is full, maximum four records.
|
|
Any call to Zone Add or Remove methods will update the Zone.SOA.Serial to
current epoch.
|
|
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.
|
|
Due to refactoring in c376eccd25, parsing SOA record with single line
return an error: "parseSOA: line 2: incomplete SOA statement '0'".
|
|
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.
|
|
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
|
|
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>.
|
|
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.
|
|
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
|
|
While at it, fix parsing multiline SOA record where closing parentheses
end on next lines.
Fixes #6
|
|
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.
|
|
The function LookupPTR accept any IP address (either IPv4 or IPv6) and
return a single domain name on success or an error on failed. If IP
address does not have PTR record it will return empty string without
error.
|
|
Previously, we use a handler for server, like server in HTTP library, to
serve query from client based on request. The idea was to make server
more generic which allow custom cache or request handling.
This is make sense if DNS response is dynamic, but in real world it is
not. DNS record actually static, either loaded from file (hosts or zone
file) or from response by recursive server.
This commit remove the server Handler and make all request to be
handled automatically based on whether the query exist on cache or not.
|
|
|
|
The implementation is based on latest draft [1].
[1] https://tools.ietf.org/html/draft-ietf-doh-dns-over-https-14
|
|
Master files are text files that contain RRs in text form. Since the
contents of a zone can be expressed in the form of a list of RRs a
master file is most often used to define a zone, though it can be used
to list a cache's contents.
|
|
|
|
|
|
|