Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Returning IPv6 addresses from DNS server in C#

Tags:

c#

ipv6

dns

I am facing some unusual problems migrating my application to work in IPv6 environments.

I'm using .NET remoting to connect to a remote service supplying a hostname. That hostname (ipv6.dt112979.company) is registered on my DNS server (running on a Windows 2003 Server with IPv6 enabled in the network card and in the DNS) as an AAAA host.

The problem is that everytime I try to connect to that server a get a "No such host is known.". I've setup Wireshark and no DNS query is being issued. I've done a "ipconfig /flushdns" and the same result is observed.

So, I've created a simple application which simply does:

Dns.GetHostAddresses("ipv6.dt112979.company");

And the result is always "No such host is found".

I've done a NSLOOKUP and the result is:

nslookup ipv6.dt112979.company
Server:  company-dev03.company
Address:  10.200.10.207

Name:    ipv6.dt112979.company
Address:  fe80::a5c3:bfde:5ece:e833

Do you have any idea of what the problem might be? I've tested this with .NET 3.5 and .NET 4.0 and the problem is the same. Tests were made in a Windows 7 machine.

If I had a A record for the ipv6.dt112979.company then the call suceeds but only returns the IPv4 address.

Best regards, Nuno Centeio

like image 983
Nuno Centeio Avatar asked Oct 10 '11 13:10

Nuno Centeio


1 Answers

I figured out the problem. I was not in a fully enabled IPv6 network. I was relying on private addresses (FE80::) and, despite of being able to perform ping and nslookup, looks like Winsocks2 doesn't like that.

I've configured Cisco UBE to have a real IPv6 network and everything started working as expected.

Thanks for your help.

like image 122
Nuno Centeio Avatar answered Sep 28 '22 09:09

Nuno Centeio