public async Task Reverse()
        {
            var dns  = new DnsClient();
            var name = await dns.ResolveAsync(IPAddress.Parse("1.1.1.1"));

            Assert.AreEqual("one.one.one.one", name);

            name = await dns.ResolveAsync(IPAddress.Parse("2606:4700:4700::1111"));

            Assert.AreEqual("one.one.one.one", name);
        }
        public async Task Resolve_Reverse()
        {
            var dns       = new DnsClient();
            var github    = "github.com";
            var addresses = await dns.ResolveAsync(github);

            foreach (var address in addresses)
            {
                var name = await dns.ResolveAsync(address);

                StringAssert.EndsWith(name.ToString(), ".com");
            }
        }
        public void Resolve_Unknown()
        {
            var dns = new DnsClient();

            ExceptionAssert.Throws <IOException>(() =>
            {
                var _ = dns.ResolveAsync("emanon.noname").Result;
            });
        }
        public void Resolve()
        {
            var dns       = new DnsClient();
            var addresses = dns.ResolveAsync("cloudflare-dns.com").Result.ToArray();

            Assert.AreNotEqual(0, addresses.Length);
            Assert.IsTrue(addresses.Any(a => a.AddressFamily == AddressFamily.InterNetwork));
            Assert.IsTrue(addresses.Any(a => a.AddressFamily == AddressFamily.InterNetworkV6));
        }
Beispiel #5
0
        public async Task Resolve()
        {
            var dns       = new DnsClient();
            var addresses = await dns.ResolveAsync("cloudflare-dns.com");

            foreach (var a in addresses)
            {
                Console.WriteLine(a.ToString());
            }
        }