dns-zonefile 1.1.3 → 1.1.5
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.travis.yml +4 -0
- data/CONTRIBUTING.md +32 -0
- data/README.md +11 -15
- data/dns-zonefile.gemspec +2 -2
- data/examples/basic.rb +12 -0
- data/examples/basic_origin.rb +15 -0
- data/examples/example.com.no-origin.zonefile +16 -0
- data/examples/example.com.zonefile +17 -0
- data/lib/dns/zonefile.treetop +1 -1
- data/lib/dns/zonefile/version.rb +1 -1
- metadata +11 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 0361c4e2fc9b1f336864f2524144ee3546394aae
|
4
|
+
data.tar.gz: a0e80ab3d8b4fc5c2a82ab9ac09e87639a72bfd2
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 05a9ebecede7d0eeb901b135b1097dd484a6eb6bd63ab89fa7ff3d5325014ec6dc9025f90e58cbcc88203ac0dfd3f9cac91a285551e617d32cfc1f8a5aebd266
|
7
|
+
data.tar.gz: 168247fe3ef6308ae9ed5bef39f29a4bb3b331e41c361681d7979afab3ea043383eb898ec770ee9c1bea937bb1df715584445195c77be430e9e33fc32e90e5fb
|
data/.travis.yml
ADDED
data/CONTRIBUTING.md
ADDED
@@ -0,0 +1,32 @@
|
|
1
|
+
# Contributing to dns-zonefile
|
2
|
+
|
3
|
+
## Getting started
|
4
|
+
|
5
|
+
Clone the repository and move into it:
|
6
|
+
|
7
|
+
```
|
8
|
+
$ git clone git@github.com:craigw/dns-zonefile.git
|
9
|
+
$ cd dns-zonefile
|
10
|
+
```
|
11
|
+
|
12
|
+
Install the dependencies using [Bundler](http://bundler.io/):
|
13
|
+
|
14
|
+
```
|
15
|
+
$ bundle
|
16
|
+
```
|
17
|
+
|
18
|
+
[Run the test suite](#testing) to check everything works as expected.
|
19
|
+
|
20
|
+
|
21
|
+
## Testing
|
22
|
+
|
23
|
+
To run the test suite:
|
24
|
+
|
25
|
+
```
|
26
|
+
$ rake
|
27
|
+
```
|
28
|
+
|
29
|
+
|
30
|
+
## Tests
|
31
|
+
|
32
|
+
Submit unit tests for your changes. You can test your changes on your machine by [running the test suite](#testing).
|
data/README.md
CHANGED
@@ -11,21 +11,14 @@ some canonical form.
|
|
11
11
|
|
12
12
|
## Getting setup
|
13
13
|
|
14
|
-
|
15
|
-
the hard work. Thanks!
|
14
|
+
Add `gem dns-zonefile` to your Gemfile
|
16
15
|
|
17
|
-
|
16
|
+
or
|
18
17
|
|
19
|
-
|
20
|
-
that I've hacked together.
|
21
|
-
|
22
|
-
rake generate_grammar
|
18
|
+
`gem install dns-zonefile`
|
23
19
|
|
24
20
|
Okay, you're ready to move onto the examples now.
|
25
21
|
|
26
|
-
The above steps should not be necessary if you install the gem via rubygems.
|
27
|
-
|
28
|
-
|
29
22
|
## Examples
|
30
23
|
|
31
24
|
Using raw data from the parser. Note that "@" isn't translated in this mode.
|
@@ -54,19 +47,22 @@ handled in this mode.
|
|
54
47
|
# get all MX records
|
55
48
|
puts zone.records_of(DNS::Zonefile::MX)
|
56
49
|
|
50
|
+
Open the examples in the `./examples` directory to see more examples.
|
57
51
|
|
58
52
|
## Authors
|
59
53
|
|
60
|
-
Original code and concept:
|
54
|
+
### Original code and concept:
|
55
|
+
|
61
56
|
Craig R Webster <http://barkingiguana.com/>
|
62
57
|
|
63
|
-
Additions:
|
64
|
-
|
58
|
+
### Additions:
|
59
|
+
|
60
|
+
- t.e.morgan <http://zerigo.com/>
|
61
|
+
- Anthony Eden <https://dnsimple.com/>
|
65
62
|
|
66
63
|
|
67
64
|
## Contributing
|
68
65
|
|
69
|
-
See the TODO.
|
70
|
-
GitHub.
|
66
|
+
See the TODO. Read CONTRIBUTING.md for more details on how to contribute to this project.
|
71
67
|
|
72
68
|
[![Build Status](https://secure.travis-ci.org/craigw/dns-zonefile.png)](http://travis-ci.org/craigw/dns-zonefile)
|
data/dns-zonefile.gemspec
CHANGED
@@ -6,8 +6,8 @@ require 'dns/zonefile/version'
|
|
6
6
|
Gem::Specification.new do |spec|
|
7
7
|
spec.name = "dns-zonefile"
|
8
8
|
spec.version = DNS::Zonefile::VERSION
|
9
|
-
spec.authors = ["Craig R Webster"]
|
10
|
-
spec.email = ["craig@barkingiguana.com"]
|
9
|
+
spec.authors = ["Craig R Webster", "Anthony Eden"]
|
10
|
+
spec.email = ["craig@barkingiguana.com", "anthonyeden@gmail.com"]
|
11
11
|
|
12
12
|
spec.summary = %q{Work with zonefiles (RFC 1035 section 5 and RFC 1034 section 3.6.1)}
|
13
13
|
spec.description = <<-EOD
|
data/examples/basic.rb
ADDED
@@ -0,0 +1,12 @@
|
|
1
|
+
# First make sure you have installed the `dns-zonefile` gem.
|
2
|
+
#
|
3
|
+
# Run this script with `ruby basic.rb`
|
4
|
+
|
5
|
+
require 'dns/zonefile'
|
6
|
+
|
7
|
+
zonefile = "example.com.zonefile"
|
8
|
+
zone = DNS::Zonefile.parse(File.read(zonefile))
|
9
|
+
|
10
|
+
puts zone.soa.origin.to_s
|
11
|
+
puts zone.soa.ns.to_s
|
12
|
+
puts zone.rr[0].to_s
|
@@ -0,0 +1,15 @@
|
|
1
|
+
# First make sure you have installed the `dns-zonefile` gem.
|
2
|
+
#
|
3
|
+
# Run this script with `ruby basic.rb`
|
4
|
+
|
5
|
+
require 'dns/zonefile'
|
6
|
+
|
7
|
+
zonefile = "example.com.zonefile"
|
8
|
+
zone = DNS::Zonefile.load(File.read(zonefile), 'example.com.')
|
9
|
+
|
10
|
+
puts zone.soa.origin
|
11
|
+
puts zone.soa.nameserver
|
12
|
+
# get all MX records
|
13
|
+
zone.records_of(DNS::Zonefile::MX).each do |rec|
|
14
|
+
puts "#{rec.host} #{rec.klass} #{rec.ttl} #{rec.priority} #{rec.domainname}"
|
15
|
+
end
|
@@ -0,0 +1,16 @@
|
|
1
|
+
$TTL 1h ; default expiration time of all resource records without their own TTL value
|
2
|
+
example.com. IN SOA ns.example.com. username.example.com. ( 2007120710 1d 2h 4w 1h )
|
3
|
+
example.com. IN NS ns ; ns.example.com is a nameserver for example.com
|
4
|
+
example.com. IN NS ns.somewhere.example. ; ns.somewhere.example is a backup nameserver for example.com
|
5
|
+
example.com. IN MX 10 mail.example.com. ; mail.example.com is the mailserver for example.com
|
6
|
+
@ IN MX 20 mail2.example.com. ; equivalent to above line, "@" represents zone origin
|
7
|
+
@ IN MX 50 mail3 ; equivalent to above line, but using a relative host name
|
8
|
+
example.com. IN A 192.0.2.1 ; IPv4 address for example.com
|
9
|
+
IN AAAA 2001:db8:10::1 ; IPv6 address for example.com
|
10
|
+
ns IN A 192.0.2.2 ; IPv4 address for ns.example.com
|
11
|
+
IN AAAA 2001:db8:10::2 ; IPv6 address for ns.example.com
|
12
|
+
www IN CNAME example.com. ; www.example.com is an alias for example.com
|
13
|
+
wwwtest IN CNAME www ; wwwtest.example.com is another alias for www.example.com
|
14
|
+
mail IN A 192.0.2.3 ; IPv4 address for mail.example.com
|
15
|
+
mail2 IN A 192.0.2.4 ; IPv4 address for mail2.example.com
|
16
|
+
mail3 IN A 192.0.2.5 ; IPv4 address for mail3.example.com
|
@@ -0,0 +1,17 @@
|
|
1
|
+
$ORIGIN example.com. ; designates the start of this zone file in the namespace
|
2
|
+
$TTL 1h ; default expiration time of all resource records without their own TTL value
|
3
|
+
example.com. IN SOA ns.example.com. username.example.com. ( 2007120710 1d 2h 4w 1h )
|
4
|
+
example.com. IN NS ns ; ns.example.com is a nameserver for example.com
|
5
|
+
example.com. IN NS ns.somewhere.example. ; ns.somewhere.example is a backup nameserver for example.com
|
6
|
+
example.com. IN MX 10 mail.example.com. ; mail.example.com is the mailserver for example.com
|
7
|
+
@ IN MX 20 mail2.example.com. ; equivalent to above line, "@" represents zone origin
|
8
|
+
@ IN MX 50 mail3 ; equivalent to above line, but using a relative host name
|
9
|
+
example.com. IN A 192.0.2.1 ; IPv4 address for example.com
|
10
|
+
IN AAAA 2001:db8:10::1 ; IPv6 address for example.com
|
11
|
+
ns IN A 192.0.2.2 ; IPv4 address for ns.example.com
|
12
|
+
IN AAAA 2001:db8:10::2 ; IPv6 address for ns.example.com
|
13
|
+
www IN CNAME example.com. ; www.example.com is an alias for example.com
|
14
|
+
wwwtest IN CNAME www ; wwwtest.example.com is another alias for www.example.com
|
15
|
+
mail IN A 192.0.2.3 ; IPv4 address for mail.example.com
|
16
|
+
mail2 IN A 192.0.2.4 ; IPv4 address for mail2.example.com
|
17
|
+
mail3 IN A 192.0.2.5 ; IPv4 address for mail3.example.com
|
data/lib/dns/zonefile.treetop
CHANGED
data/lib/dns/zonefile/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,15 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: dns-zonefile
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.1.
|
4
|
+
version: 1.1.5
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Craig R Webster
|
8
|
+
- Anthony Eden
|
8
9
|
autorequire:
|
9
10
|
bindir: exe
|
10
11
|
cert_chain: []
|
11
|
-
date: 2016-
|
12
|
+
date: 2016-12-26 00:00:00.000000000 Z
|
12
13
|
dependencies:
|
13
14
|
- !ruby/object:Gem::Dependency
|
14
15
|
name: treetop
|
@@ -90,12 +91,15 @@ description: |
|
|
90
91
|
some canonical form.
|
91
92
|
email:
|
92
93
|
- craig@barkingiguana.com
|
94
|
+
- anthonyeden@gmail.com
|
93
95
|
executables: []
|
94
96
|
extensions: []
|
95
97
|
extra_rdoc_files: []
|
96
98
|
files:
|
97
99
|
- ".gitignore"
|
98
100
|
- ".rspec"
|
101
|
+
- ".travis.yml"
|
102
|
+
- CONTRIBUTING.md
|
99
103
|
- Dockerfile
|
100
104
|
- Gemfile
|
101
105
|
- LICENCE
|
@@ -111,6 +115,10 @@ files:
|
|
111
115
|
- doc/example3.com.zone
|
112
116
|
- doc/zonefile.example
|
113
117
|
- docker-compose.yml
|
118
|
+
- examples/basic.rb
|
119
|
+
- examples/basic_origin.rb
|
120
|
+
- examples/example.com.no-origin.zonefile
|
121
|
+
- examples/example.com.zonefile
|
114
122
|
- lib/dns/zonefile.rb
|
115
123
|
- lib/dns/zonefile.treetop
|
116
124
|
- lib/dns/zonefile/version.rb
|
@@ -134,7 +142,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
134
142
|
version: '0'
|
135
143
|
requirements: []
|
136
144
|
rubyforge_project:
|
137
|
-
rubygems_version: 2.
|
145
|
+
rubygems_version: 2.5.1
|
138
146
|
signing_key:
|
139
147
|
specification_version: 4
|
140
148
|
summary: Work with zonefiles (RFC 1035 section 5 and RFC 1034 section 3.6.1)
|