This package intends to import and export RFC compliant DNS resource records. Please raise an issue if you cannot pass a valid resource record or you can pass an invalid resource record.
This package is for working with individual Resource Records. For working with zones of RRs, use dns-zone.
Validate records by passing a properly formatted JS object to the record-specific class. To validate an A record:
const validatedA = newRR.A(exampleRRs.A)
Manipulate the validated record using pattern named setters:
console.log(validatedA.toBind())
test.example.com. 3600IN A 192.0.2.127
validatedA.setAddress('192.0.2.128')
console.log(validatedA.toBind())
test.example.com. 3600IN A 192.0.2.128
The setters are named: set + Field, where field is the resource record field name to modify. Multi-word names are camel cased, so a field named Certificate Usage has a setter named setCertificateUsage. The RFCs aren't always consistent regarding RR field names so aliases are permissible for interoperability.
FUNCTIONS
Get the field names for each RR type with getFields():
console.log(newRR.A(exampleRRs.A).toBind())
test.example.com3600IN A 192.0.2.127console.log(newRR.AAAA(exampleRRs.AAAA).toBind())
test.example.com3600INAAAA2605:7900:20:a::4
to{Bind|MaraDNS} output can be influenced (suppress TTL, class, relative domain names) with an options object. See it in bin/dns-zone in the dns-zone package.
RFC 4034: if the type of RR is NS, MD, MF, CNAME, SOA, MB,
MG, MR, PTR, HINFO, MINFO, MX, RP, AFSDB, RT, SIG, PX, NXT,
NAPTR, KX, SRV, DNAME, A6, RRSIG, or NSEC, all uppercase
letters in the DNS names contained within the RDATA are replaced by the lowercase letters;
LOC record ingest/out isn't consistent with API
export a web page for each RR type
DEVELOP
this package has no dependencies. That's no accident.
this will be used by a node.js app & a browser based app, so ES modules
The npm package dns-resource-record receives a total of 0 weekly downloads. As such, dns-resource-record popularity was classified as not popular.
We found that dns-resource-record demonstrated a not healthy version release cadence and project activity because the last version was released a year ago.It has 1 open source maintainer collaborating on the project.
Last updated on 29 May 2022
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
NIST's new AI Risk Management Framework aims to enhance the security and reliability of generative AI systems and address the unique challenges of malicious AI exploits.
This episode of the Risky Biz podcast discusses how the rise of small open source packages and the shift towards individual maintainers makes the ecosystem more vulnerable to supply chain attacks.
Streamline your login process and enhance security by enabling Single Sign-On (SSO) on the Socket platform, now available for all customers on the Enterprise plan, supporting 20+ identity providers.