Skip to content

Commit

Permalink
Update readme and todo to reflect new features and usage.
Browse files Browse the repository at this point in the history
  • Loading branch information
zarqman authored and craigw committed Oct 26, 2011
1 parent 70f6ee5 commit 884e995
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 8 deletions.
28 changes: 26 additions & 2 deletions README
Expand Up @@ -25,24 +25,48 @@ that I've hacked together.

Okay, you're ready to move onto the examples now.

The above steps should not be necessary if you install the gem via rubygems.


Examples
--------

Using raw data from the parser. Note that "@" isn't translated in this mode.
Nor are inherited TTLs interpreted.

zonefile = "/path/to/file.zone"
zone_string = File.read(zonefile)
zone = DNS::Zonefile.parse(zone_string)

puts zone.soa.origin.to_s
puts zone.soa.ns.to_s
puts zone.rr[0].to_s

Using more structure data. @, TTLs, and empty hostname inheritance are all
handled in this mode.

zonefile = "/path/to/file.zone"
zone_string = File.read(zonefile)
zone = DNS::Zonefile.load(zone_string)
# or, if no $origin is in the zone file
zone = DNS::Zonefile.load(zone_string, 'example.com.')

puts zone.soa.origin
puts zone.soa.ns
puts zone.resource_records[0]
puts zone.soa.nameserver
puts zone.records[1]
# get all MX records
puts zone.records_of(DNS::MX)


Authors
-------

Original code and concept:
Craig R Webster <http://barkingiguana.com/>

Additions:
t.e.morgan <http://zerigo.com/>


Contributing
------------
Expand Down
8 changes: 2 additions & 6 deletions TODO
@@ -1,8 +1,4 @@
* Allow empty host strings which expand to the zone origin eg:
[spaces] MX 100 mail4
-> example.com. MX 100 mail4.example.com.
* Support more record types: http://www.dns.net/dnsrd/rr.html
* Output the zone object-graph as a zone string.
* Should this support sub-types of TXT records - should we recognise
SPF records as special TXT records or are these just TXT records?
* Allow comparison of resource records and zones for checking equality.
* Allow comparison of resource records and zones for checking equality.
* Allow unqualified ns and rp in SOA

0 comments on commit 884e995

Please sign in to comment.