notwaldorf / cat-dns Goto Github PK
View Code? Open in Web Editor NEW:computer::cat: A DNS server that resolves everything to cats.
Home Page: http://meowni.ca/posts/go-cat-dns-go/
License: MIT License
:computer::cat: A DNS server that resolves everything to cats.
Home Page: http://meowni.ca/posts/go-cat-dns-go/
License: MIT License
54.197.244.191 is down, I am even trying to ping it but no response
The issues I've opened have been filed in good humour, in case you're interested in figuring ways to handle them. I also have patches for them, but wasn't sure if that would be some kind of spoiler for the enjoyment of tinkering with low-level protocols.
Why cats ?
why not any other thing or animals ?
Is this because CATS have ESP ?
or any other reason ?
&& why intel-coders love CATS so much ?
I can't figure it out..
PS I don't hate cats, I love wild-cats
:-D
The cat-dns query name parser assumes that the query name is at the end of the DNS query, minus 4 bytes. This doesn't work if the query includes an EDNS0 option. See RFC2671, EDNS0 options show up as OPT records in the additional section of a query. To parse the query name, you need to start 12 bytes in to the message (after the header) and then add each label, so; www.example.com appears on the wire as;
\3www\7example\3com\0
so the full qname length in bytes is is 3 + 1 + 7 + 1 + 3 + 1 + 0 + 1 (the plus ones are for the byte encoding the label length) and iteration is needed.
Technically this math is valid only if the label length is a value <= 63 (otherwise it's a label-compressed pointer, and counts as one byte), but this can be ignored in the question section (which is never compressed).
cat-dns.js includes the http package, but doesn't seem to use it.
cat-dns.js behaves like an authoritative name-server, but does not set the AA bit. Surely cat-dns is authoritative about cats in dns.
cat-dns's answers don't include the original question, in violation of RFC1035. DNS answers must include the original question being asked. So the qd_count should be 1, the an_count should be 1 (since cats have just one IP address) and ar_count and ns_count should always be zero.
Per #5 cat-dns does not include the original question. One fix for this is to simply emit the question section and answer section in full, e.g.;
[12 byte header]
\3www\7example\3com\0\0\1\0\1
\3www\7example\3com\0\0\1\0\1\0\0\0\1\0\0\4\54\197\244\191
but DNS also supports label compression where labels can point to previous identical labels. See section 4.1.4. of RFC1035.
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.