Skip to content

Commit

Permalink
Merge pull request #17 from richardschneider/dot-google
Browse files Browse the repository at this point in the history
feat(DotClient): Google now supports DNS over TLS
  • Loading branch information
richardschneider authored May 23, 2019
2 parents a5f4914 + ca68967 commit 4d8591a
Show file tree
Hide file tree
Showing 2 changed files with 44 additions and 0 deletions.
20 changes: 20 additions & 0 deletions src/DotClient.cs
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,26 @@ public class DotClient : DnsClientBase
Address = IPAddress.Parse("1.0.0.1")
},
new DotEndPoint
{
Hostname = "dns.google",
Address = IPAddress.Parse("2001:4860:4860::8888")
},
new DotEndPoint
{
Hostname = "dns.google",
Address = IPAddress.Parse("2001:4860:4860::8844")
},
new DotEndPoint
{
Hostname = "dns.google",
Address = IPAddress.Parse("8.8.8.8")
},
new DotEndPoint
{
Hostname = "dns.google",
Address = IPAddress.Parse("8.8.4.4")
},
new DotEndPoint
{
Hostname = "securedns.eu",
Pins = new[] { "h3mufC43MEqRD6uE4lz6gAgULZ5/riqH/E+U+jE3H8g=" },
Expand Down
24 changes: 24 additions & 0 deletions test/DotClientTest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -298,6 +298,7 @@ public async Task Query_Cloudflare_IPv6()
}

[TestMethod]
[Ignore("https://github.com/richardschneider/net-udns/issues/18")]
public async Task Query_Quad9()
{
using (var dot = new DotClient
Expand All @@ -311,6 +312,29 @@ public async Task Query_Quad9()
}
}
})
{
var query = new Message { RD = true, Id = 1234 };
query.Questions.Add(new Question { Name = "ipfs.io", Type = DnsType.TXT });
var response = await dot.QueryAsync(query);
Assert.IsNotNull(response);
Assert.AreNotEqual(0, response.Answers.Count);
}
}

[TestMethod]
public async Task Query_Google()
{
using (var dot = new DotClient
{
Servers = new[]
{
new DotEndPoint
{
Hostname = "dns.google",
Address = IPAddress.Parse("8.8.8.8")
}
}
})
{
var query = new Message { RD = true };
query.Questions.Add(new Question { Name = "ipfs.io", Type = DnsType.TXT });
Expand Down

0 comments on commit 4d8591a

Please sign in to comment.