Re: [twsocket] TDnsQuery and DnsQueryAAAA

2017-09-05 Thread Max Terentiev
Angus, thank you very much ! I will try this unit !

---
With best regards, Max Terentiev.
Business Software Products.
AMS Development Team.
supp...@bspdev.com

-Original Message-
From: TWSocket [mailto:twsocket-boun...@lists.elists.org] On Behalf Of Angus
Robertson - Magenta Systems Ltd
Sent: Tuesday, September 5, 2017 8:40 PM
To: twsocket@lists.elists.org
Subject: Re: [twsocket] TDnsQuery and DnsQuery

> I need to resolve IPv6 address for domain name (google.com ->
> 2607:f8b0:4006:80e:0:0:0:200e)
> To do it I call:
> DnsQuery.QueryAny('google.com',DnsQuery);

The component does not currently support  records directly.  

You can use WSocketIPv6ToStr to convert the 16 bytes of IPv6 address data to
a string. 

I'll email you a DnsQuery2 version I created 15 years ago from a heavily
rewritten version that never got incorporated into ICS, and the two versions
have departed too much to it even harder today.  But it does what you need.
Not tested on unicode compilers I'm afraId. 
Sent Query to: 192.168.1.118 for: www.google.com Answers are not
Authoritative DNS Query for www.google.com: 216.58.212.228  (ipv6) Query
for www.google.com: 2a00:1450:400e:803::2004

Angus



--
To unsubscribe or change your settings for TWSocket mailing list please goto
http://lists.elists.org/cgi-bin/mailman/listinfo/twsocket
Visit our website at http://www.overbyte.be

-- 
To unsubscribe or change your settings for TWSocket mailing list
please goto http://lists.elists.org/cgi-bin/mailman/listinfo/twsocket
Visit our website at http://www.overbyte.be


Re: [twsocket] TDnsQuery and DnsQueryAAAA

2017-09-05 Thread Angus Robertson - Magenta Systems Ltd
> I need to resolve IPv6 address for domain name (google.com -> 
> 2607:f8b0:4006:80e:0:0:0:200e)
> To do it I call:
> DnsQuery.QueryAny('google.com',DnsQuery);

The component does not currently support  records directly.  

You can use WSocketIPv6ToStr to convert the 16 bytes of IPv6 address
data to a string. 

I'll email you a DnsQuery2 version I created 15 years ago from a
heavily rewritten version that never got incorporated into ICS, and the
two versions have departed too much to it even harder today.  But it
does what you need.  Not tested on unicode compilers I'm afraId. 
Sent Query to: 192.168.1.118 for: www.google.com
Answers are not Authoritative
DNS Query for www.google.com: 216.58.212.228
 (ipv6) Query for www.google.com: 2a00:1450:400e:803::2004

Angus



-- 
To unsubscribe or change your settings for TWSocket mailing list
please goto http://lists.elists.org/cgi-bin/mailman/listinfo/twsocket
Visit our website at http://www.overbyte.be


[twsocket] TDnsQuery and DnsQueryAAAA

2017-09-05 Thread Max Terentiev
Hi,

I need to resolve IPv6 address for domain name (google.com -> 
2607:f8b0:4006:80e:0:0:0:200e)

To do it I call:

DnsQuery.QueryAny('google.com',DnsQuery);

But how to decode/get resolved IPv6 address in DnsQuery.OnRequestDone ?

I get IPv4 like this 
ResultIP:=AnsiString(WSocket_inet_ntoa(DnsQuery.Address[Index]));

But it's not working for IPv6 !

Please help !

---
With best regards, Max Terentiev.
Business Software Products.
AMS Development Team.
supp...@bspdev.com



-- 
To unsubscribe or change your settings for TWSocket mailing list
please goto http://lists.elists.org/cgi-bin/mailman/listinfo/twsocket
Visit our website at http://www.overbyte.be