Git Product home page Git Product logo

net-dns's Issues

ASCII strings

All DNS strings are USASCII.

WireWriter.WriteString and WireReader.ReadString must enforce this.

Empty TXT record

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```

Malformed RDATA

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

Cannot read Message

The following unecrypted Message (in base-64) can not be decoded. It came from cloudflare using DNS over TLS (DOT).

EjSBgAABAAEAAAAABGlwZnMCaW8AABAAAcAMABAAAQAAADwAPTxkbnNsaW5rPS9pcGZzL1FtWU5RSm9LR05IVHBQeENCUGg5S2tEcGFFeGdkMmR1TWEzYUY2eXRNcEhkYW8=

Reading resource record fails

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

RFC 1183

Add the resource records for https://tools.ietf.org/html/rfc1183

  • AFSDB - Andrew File System Database
  • RP - Responsible Person
  • X25 - X.25 (Not in current use)
  • ISDN - Integrated Service Digital Network (Not in current use)
  • RT - Route Through (Not in current use)

Escaped strings

DnsWriter.WriteString must quote the string if it contains a quote, backslash or space.

Update SimpleBase to latest version

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'.

Development has moved

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.

UpdateMessage

Do you have plans to support this project?
Will be good to have a possibility to update DNS records

DnsObject extras

Value equality, hashing and deep cloning can be implemented because of object serialisation.

Master file escaping

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.

Road map to v1

  • rename DnsReader/DnsWriter => WireReader/WireWriter
  • rename Class to DnsClass
  • rename to master to presentation
  • add PresentationReader
  • implement TSIG, TKey
  • Add a SecurityAlgoithm registry
  • Fix TODOs, or create an issue
  • More articles
    • describe serialisation
    • describe the registries
    • DSNSEC

RRSIG and dates

The SignatureExpiration and SignatureExpiration should use the DateTime type.

Presentation format should always YYYYMMDDHHmmSS format. But accept number seconds since Unix epoch.

Adding Additional Records

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.

Domain name labels

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.

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.