Giter Club home page Giter Club logo

dns-zonefile's People

Contributors

aeden avatar asimon avatar craigw avatar dependabot-preview[bot] avatar dimitertodorov avatar eam avatar olleolleolle avatar prees1 avatar tpbowden avatar zarqman avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

dns-zonefile's Issues

1.1.0 fails to load grammar

When I load the gem, I get the following error:

$ pry
[1] pry(main)> require "dns/zonefile"
Errno::ENOENT: No such file or directory @ rb_sysopen - lib/dns/zonefile.treetop
from /Users/kerry/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/treetop-1.6.5/lib/treetop/compiler/grammar_compiler.rb:37:in `initialize'

It looks like this is a load path issue, as if I edit the gem source to expand the full path of zonefile.treetop the error disappears.

Remove parser.rb from source control?

Is it possible to remove parser.rb from source control since it is a generated file? It is very hard to apply upstream changes, or supply clean, sensible PRs, with potential conflicts in this generated file.

"Extraneous module ignored with nested atomic" on require

After upgrading to 1.1.3 I'm getting the following output every time I require the gem in ruby 2.3.1. As far as I can tell it's a treetop related issue:

rb(main):001:0> require "dns/zonefile"
Extraneous module ignored with nested atomic: "(\n     host space ms_age ttl klass \"CNAME\" space target:host /\n     host space klass ms_age ttl \"CNAME\" space target:host /\n     host space ms_age ttl \"CNAME\" space target:host /\n     host space klass \"CNAME\" space target:host \n    ) {\n      def to_s\n        \"\#{host} \#{ttl} \#{klass} CNAME \#{target}\"\n      end\n\n      def record_type\n        \"CNAME\"\n      end\n    }"
Extraneous module ignored with nested atomic: "(\n     host space ms_age ttl klass \"SRV\" space priority:integer space weight:integer space port:integer space target:host /\n     host space klass ms_age ttl \"SRV\" space priority:integer space weight:integer space port:integer space target:host /\n     host space ms_age ttl \"SRV\" space priority:integer space weight:integer space port:integer space target:host /\n     host space klass \"SRV\" space priority:integer space weight:integer space port:integer space target:host\n    ) {\n      def to_s\n        \"\#{host} \#{ttl} \#{klass} SRV \#{priority} \#{weight} \#{port} \#{target}\"\n      end\n\n      def record_type\n        \"SRV\"\n      end\n    }"
Extraneous module ignored with nested atomic: "((\"IN\" space) / '') {\n      def to_s\n        text_value.strip\n      end\n    }"
Extraneous module ignored with nested atomic: "( \"[AGE:\" [\\d]+ \"]\" space / '' ) {\n      def to_s\n        text_value\n      end\n    }"
Extraneous module ignored with nested atomic: "((time_interval space) / '') {\n      def to_i\n        respond_to?(:time_interval) ? time_interval.to_i : nil\n      end\n      def to_s\n        respond_to?(:time_interval) ? time_interval.to_s : ''\n      end\n    }"
Extraneous module ignored with nested atomic: "(\n      \"(\" space* data:txt_data space* \")\" /\n      data:txt_data\n    ) {\n      def to_s\n        data.to_s\n      end\n    }"
Extraneous module ignored with nested atomic: "( '\"' ( '\\\"' / [^\"] )* '\"') {\n      def to_s\n        text_value\n      end\n    }"

Parsing MS DNS Records

Hi,

Trying to parse a DNS zonefile as created by exporting from Microsoft DNS server.
It fails on the following parts.
Short of requesting this to be fixed since it might not conform to the RFC standards noted, is there any way we could make the parser ignore lines that do not conform.

Line:
_nfsv4idmapdomain       86400   TXT ( "some.domain.com" )
Failure:
DNS::Zonefile::ParsingError: Expected one of [ \t], '"', [a-zA-Z0-9] at line 35, column 35 (byte 1237) after _nfsv4idmapdomain       86400  TXT

Line:
hostname001         [AGE:3636591]   1200    A   10.195.200.240
Failure:
DNS::Zonefile::ParsingError: Expected one of [ \t], [0-9], "IN", "A", "AAAA", "CNAME", "MX", "NAPTR", "NS", "PTR", "SRV", "SPF", "TXT", ";", "SOA" at line 2844, column 25 (byte 114536) after hostname001

Parsing issue with Bind zonefiles

We experienced a weird parsing issue with a normally OK bind zonefile.

The parser expects a SOA record right after the $ORIGIN definition, but it's not always work.

I've a following zone:

$ORIGIN .
$TTL 3600   ; 1 hour
192.168.2.1       IN A    192.168.2.1
router.domain.com A  192.168.2.1
mydomain.com     SOA ns.domain.com. hostmaster.domain.com. (
                26         ; serial
                900        ; refresh (15 minutes)
                600        ; retry (10 minutes)
                86400      ; expire (1 day)
                3600       ; minimum (1 hour)
                )

And it works totally fine with Bind but DNS::Zonefile fails to parse it.

Output the zone object-graph as a zone string

The TODO contains this entry.

Does anyone have thoughts on what it'd take to do this? I've not really put any energy into it yet, but just wanted to check if anyone had thoughts/notes?

TXT data should be treated as binary

According to RFC 1035:

<character-string> is a single
length octet followed by that number of characters.  <character-string>
is treated as binary information, and can be up to 256 characters in
length (including the length octet).

and

<character-string> is expressed in one or two ways: as a contiguous set
of characters without interior spaces, or as a string beginning with a "
and ending with a ".  Inside a " delimited string any character can
occur, except for a " itself, which must be quoted using \ (back slash).

Therefore unquoted TXT data should be treated as the first contiguous character string of 1 to 255 characters following the TXT type declaration, and quoted TXT data should be treated as any contiguous character string of 1 to 255 characters, inside quotes.

At the moment unquoted TXT is limited to a regular expression that still includes many allowable characters, which should instead be changed to allow any non whitespace, however trying to make this change currently breaks the spec.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.