proxy.golang.org : github.com/davecheney/godns
DOMAIN NAME SYSTEM Package dns implements a full featured interface to the Domain Name System. The package allows complete control over what is send out to the DNS. Resource records are native types. They are not stored in wire format. Basic usage pattern for creating a new resource record: Or directly from a string: The package dns supports (async) querying/replying, incoming/outgoing Axfr/Ixfr, TSIG, EDNS0, dynamic updates, notifies and DNSSEC validation/signing. Note that domain names MUST be full qualified, before sending them. The packages enforces this, by throwing a panic(). In the DNS messages are exchanged. Use pattern for creating one: The message m is now a message with the question section set to ask the MX records for the miek.nl. zone. The following is slightly more verbose, but more flexible: After creating a message it can be send. Basic use pattern for synchronous querying the DNS: An asynchronous query is also possible, setting up is more elaborate then a synchronous query. The Basic use pattern is: DNSSEC (DNS Security Extension) adds a layer of security to the DNS. It uses public key cryptography to securely sign resource records. The public keys are stored in DNSKEY records and the signatures in RRSIG records. TRANSACTION SIGNATURE (TSIG) A TSIG or transaction signature adds a HMAC TSIG record to each message sent. Basic use pattern when querying with TSIG: The secrets' map index is set to 'axfr.'. This must match the ownername of the TSIG record, which in the above example, is also set to 'axfr.' The message requesting an AXFR (almost all TSIG usage is when requesting zone transfers) for miek.nl with the TSIG record added is now ready to use. We now need a new client with access to the secrets: You can now read the records from the AXFR as they come in. Each envelope is checked with TSIG. If something is not correct an error is returned. Basic use pattern replying to a message that has TSIG set. TODO(mg) Dynamic updates reuses the DNS message format, but renames three of the sections. Question is Zone, Answer is Prerequisite, Authority is Update, only the Additional is not renamed. See RFC 2136 for the gory details. You can set a rather complex set of rules for the existence of absence of certain resource records or names in a zone to specify if resource records should be added or removed. The table from RFC 2136 supplemented with the Go DNS function shows which functions exist to specify the prerequisites. 3.2.4 - Table Of Metavalues Used In Prerequisite Section The prerequisite section can also be left empty. If you have decided on the prerequisites you can tell what RRs should be added or deleted. The next table shows the options you have and what functions to call. 3.4.2.6 - Table Of Metavalues Used In Update Section
Registry
-
Source
- Documentation
- JSON
purl: pkg:golang/github.com/davecheney/godns
License: BSD-3-Clause
Latest release: 11 days ago
Namespace: github.com/davecheney
Stars: 6 on GitHub
Forks: 0 on GitHub
See more repository details: repos.ecosyste.ms
Last synced: 11 days ago