I encountered an interesting problem with ipv6-mode for DNS resolution of domain names in /sockopen.

For example:
/sockopen -d 1.2.3.4 255.255.255.255 80

As we all know, would, open a socket bound to interface '1.2.3.4' targeting address '255.255.255.255'.

For the sake of another example, <some.com> would have IP address: 255.255.255.255.

In IPv4 mode this:
/sockopen -d 1.2.3.4 <some.com> 80

would target 255.255.255.255 because ipv4 DNS resolution would register an ipv4 IP address to connect to.


Now, in IPv6 mode the first example would still work (/sockopen -d 1.2.3.4 255.255.255.255 80) because it is by passing the IPv6 DNS resolution and using a specific IPv4 address as a target. However this would not work.

<some.com> = 255.255.255.255
/sockopen -d 1.2.3.4 <some.com> 80

Because IPv6 mode explicitly forces DNS resolution as 'ipv6' a socket to an ipv4 website can not be made even if the bound local interface is an IPv4 address. The $sockerr error returned in a SOCKOPEN event would be '[0] Unknown Error' and it would fail to proceed.