lantins / dns-zone Goto Github PK
View Code? Open in Web Editor NEWA Ruby library for building and parsing DNS zone files.
License: MIT License
A Ruby library for building and parsing DNS zone files.
License: MIT License
You should be able to start using the lib after scanning the README.md file or looking at the yard generated documentation available at http://www.rubydoc.info/gems/dns-zone/
Even basic methods like dump
are not documented.
I opened some pull requests two months ago, no reaction yet. Last commit almost 3 years ago.
So, is this project abandoned? New maintainer needed? @lantins
I'd like to avoid forking and publishing under a different name on Rubygems. But I don't see much other options when I need some fixes or features. (Note that specifying a Github repo as dependency is not possible in a gemspec file.)
Updating the SOA in the example does not actually work!
zone.soa.nameserver = 'ns0.lividpenguin.com.'
The SOA is just another RR and is treated the same, the exception is it must be the first RR and you can only have one of them.
So the 'short hand' syntax makes sense, this should be supported.
Hi, i have problem with loading MX records, where server si not domain name, but just "mail".
For example:
MX 10 mail
mail A some_ip
It's valid record, but you don't load it because you expect full domain name like mail.example.com.
It appears that zonefiles that use lowercase class and RR type keywords are causing DNS::Zone.load
to choke and throw an exception:
#! /usr/bin/ruby
require('rubygems')
require('dns/zone')
zdata = <<EOT
$ttl 3600
$origin dnszone.example.com.
@ in soa ns1.example.com. hostmaster.dnszone.example.com. (
2012052400 ; serial
345600 ; refresh
3600 ; retry
604800 ; expire
3600 ; ttl
)
EOT
DNS::Zone.load(zdata)
=> RuntimeError: Unknown or unsupported RR Type
from /usr/local/share/gems/gems/dns-zone-0.3.1/lib/dns/zone/rr.rb:56:in `load'
from /usr/local/share/gems/gems/dns-zone-0.3.1/lib/dns/zone.rb:105:in `block in load'
from /usr/local/share/gems/gems/dns-zone-0.3.1/lib/dns/zone.rb:91:in `each'
from /usr/local/share/gems/gems/dns-zone-0.3.1/lib/dns/zone.rb:91:in `load'
There is no requirement that the keywords be uppercase.
I'll see if I can work up a patch for this.
This is handy when the zone file does not contain an $ORIGIN directive.
cc @mrideout
Zone files with more than one $ORIGIN will produce incorrect (repeating) labels for records with later $ORIGINs that don't explicitly set their name to either '@' or some other name.
For example:
$ORIGIN example.com.
@ 3600 SOA ns1.example.com. (
hostmaster.example.com.
42
3600
600
86400
300
)
$ORIGIN sub.example.com.
@ 3600 CNAME sub2.example.com.
3600 MX 10 mail.example.com.
will produce:
> zone = DNS::Zone::load(File.read('test.zone'))
> zone.records.each{ |r| puts r.label }
@
sub
sub.sub
where the third label should be 'sub'.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.