richardschneider / net-dns Goto Github PK
View Code? Open in Web Editor NEWDNS data model and Name Server with serializer for the wire and master file format
License: MIT License
DNS data model and Name Server with serializer for the wire and master file format
License: MIT License
All DNS strings are USASCII.
WireWriter.WriteString
and WireReader.ReadString
must enforce this.
Reading a TXT record with no strings is treated as malformed. It should be accepted.
2018/07/09 13:48:59:489 [WARN] Makaretu.Dns.MulticastService - Received malformed message
=======================================================(inner most exception)===
(1) System.IO.EndOfStreamException
================================================================================
Method : ReadBytes
Type : Makaretu.Dns.DnsReader
Assembly : Makaretu.Dns, Version=0.11.0.0, Culture=neutral, PublicKeyToken=null
Assembly Path : C:\Users\Owner\Documents\GitHub\net-mdns\test\bin\Debug\net461\Makaretu.Dns.dll
Source : Makaretu.Dns
Thread : 6 ''
Helplink :
Message:
"Attempted to read past the end of the stream."
Stack Trace:
at Makaretu.Dns.DnsReader.ReadBytes(Int32 length)
at Makaretu.Dns.DnsReader.ReadString()
at Makaretu.Dns.TXTRecord.ReadData(DnsReader reader, Int32 length)
at Makaretu.Dns.ResourceRecord.Read(DnsReader reader)
at Makaretu.Dns.Message.Read(DnsReader reader)
at Makaretu.Dns.DnsObject.Read(Byte[] buffer, Int32 offset, Int32 count)
at Makaretu.Dns.MulticastService.OnDnsMessage(Byte[] datagram, Int32 length) in C:\Users\Owner\Documents\GitHub\net-mdns\src\MulticastService.cs:line 403```
An exception (InvalidateDataException maybe) should be thrown by Read(DnsReader reader)
after calling ReadData
if the position and RDLEN do not agree. This is the inverse of Buffer Overflow
Make the record more user friendly.
Instead of byte[] TypeBitmaps
use List<DnsType> Types
.
See https://tools.ietf.org/html/rfc3845 for details.
The following unecrypted Message (in base-64) can not be decoded. It came from cloudflare using DNS over TLS (DOT).
EjSBgAABAAEAAAAABGlwZnMCaW8AABAAAcAMABAAAQAAADwAPTxkbnNsaW5rPS9pcGZzL1FtWU5RSm9LR05IVHBQeENCUGg5S2tEcGFFeGdkMmR1TWEzYUY2eXRNcEhkYW8=
Wildcard queries are not supported.
Also #28 does not allow "*" in a domain name.
Define the Notify message in https://tools.ietf.org/html/rfc1996
Add the resources records for https://tools.ietf.org/html/rfc2065 https://tools.ietf.org/html/rfc4035
See also Important Additions to DNSSEC and RRs for DNSSEC.
ReadToken
should handle escaped octal digits, such as \1
or \123
.
2018/05/27 22:16:47:905 [DEBUG] Makaretu.Dns.DotClient - using dns server 'cloudflare-dns.com' 1.1.1.1.
2018/05/27 22:16:47:906 [DEBUG] Makaretu.Dns.DotClient - Starting reader thread
2018/05/27 22:16:47:906 [DEBUG] Makaretu.Dns.DotClient - query #15311 for 'www.opinionstage.com A'
2018/05/27 22:16:47:924 [ERROR] Makaretu.Dns.DotClient - System.Collections.Generic.KeyNotFoundException: The given key was not present in the dictionary.
at System.ThrowHelper.ThrowKeyNotFoundException()
at System.Collections.Generic.Dictionary`2.get_Item(TKey key)
at Makaretu.Dns.ResourceRecord.Read(DnsReader reader)
at Makaretu.Dns.Message.Read(DnsReader reader)
at Makaretu.Dns.DnsObject.Read(Byte[] buffer, Int32 offset, Int32 count)
at Makaretu.Dns.DotClient.ReadResponses(Stream stream) in C:\Users\Owner\Documents\GitHub\net-udns\src\DotClient.cs:line 380
Implement the OPT resource record from https://tools.ietf.org/html/rfc6891
Add the resource records for https://tools.ietf.org/html/rfc1183
DnsWriter.WriteString
must quote the string if it contains a quote, backslash or space.
Add the TSIG resource record from https://tools.ietf.org/html/rfc2845
Add the LOC resource record defined in https://tools.ietf.org/html/rfc1876
Hi @richardschneider , thank you for the repo!
When I update the simplebase to latest version of 3.0.2 I am getting below error:
Error MT2101: Can't resolve the reference 'System.Byte[] SimpleBase.Base16::Decode(System.String)', referenced from the method 'System.Void Makaretu.Dns.DSRecord::ReadData(Makaretu.Dns.PresentationReader)' in 'SimpleBase, Version=1.3.1.0, Culture=neutral, PublicKeyToken=null'.
Make the NameServer security aware; see https://tools.ietf.org/html/rfc4035#section-3.1
This should likely check the UTF-8 encoded version of the string or something similar, not the default C# representation of string. Which is, at least on windows, a UTF-16 encoded string.
Line 273 in 701463d
Since development has ended here I have continued the project at:
https://github.com/jdomnitz/net-dns
NuGet Packages will continue to be published to:
Makaretu.Dns.New
This includes new features, bug fixes and modern framework targets. Tickets and PRs are welcome.
Do you have plans to support this project?
Will be good to have a possibility to update DNS records
See the build
Appveyor is using docfx v2.38.1. Locally 2.36.1.0 works.
Value equality, hashing and deep cloning can be implemented because of object serialisation.
From RFC 1035
\DDD where each D is a digit is the octet corresponding to
the decimal number described by DDD. The resulting
octet is assumed to be text and is not checked for
special meaning.
For some reason the Presention Reader/Writer is treating escaped numbers as octal. They should be treated as decimal.
master
to presentation
The SignatureExpiration
and SignatureExpiration
should use the DateTime type.
Presentation format should always YYYYMMDDHHmmSS format. But accept number seconds since Unix epoch.
Currently the NameServer
will add most likely needed resources to the AdditionalRecords
. For example a query for a PTR
will return the SRV
and TXT
as additional records and a SRV
query will return the target host address (A/AAAA
) records.
A query for a PTR
should also return the address for the target host.
This is needed by some peer-to-peer systems, where they expect the PTR
response to contain all the information needed to contact the peer.
The standard requires that domain name labels consist of only USASCII letters, digits or '-'. This is somewhat mitigated by Internationalized Domain Names .
WireFormat.ReadDomainName
should throw InvalidDataExecption
for characters outside this range. For the time being, WireFormat.WriteDomainName
show throw InvalidArgumentException
.
PresentationFormat
is not affected, because it can be UNICODE.
From https://tools.ietf.org/html/rfc1035#section-2.3.1
<label> ::= <letter> [ [ <ldh-str> ] <let-dig> ]
<ldh-str> ::= <let-dig-hyp> | <let-dig-hyp> <ldh-str>
<let-dig-hyp> ::= <let-dig> | "-"
<let-dig> ::= <letter> | <digit>
<letter> ::= any one of the 52 alphabetic characters A through Z in
upper case and a through z in lower case
<digit> ::= any one of the ten digits 0 through 9
Note that while upper and lower case letters are allowed in domain
names, no significance is attached to the case. That is, two names with
the same spelling but different case are to be treated as if identical.
The labels must follow the rules for ARPANET host names. They must
start with a letter, end with a letter or digit, and have as interior
characters only letters, digits, and hyphen. There are also some
restrictions on the length. Labels must be 63 characters or less.
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.