facing problem with gethostbyname2()

Stefan Puiu stefan.puiu at gmail.com
Thu Jul 28 13:53:59 UTC 2005


Not sure how gethostbyname2() is supposed to work, but have you tried
getaddrinfo()? That one's supposed to handle both IPv6 and IPv4
addresses. Not sure about IPv4-mapped-IPv6.

And what do you mean by the 'BIND 9.2.3 resolver library'? Are you
specifically linking with the version of libbind provided with that
version of BIND?

On 7/28/05, Gajanana Dixit <Gajanana.Dixit at wipro.com> wrote:
>=20
>=20
> Hi,
>=20
> I am using Bind 9.2.3 resolver library, I am facing some problem with
> gethostbyname2(), I am not able to get IPv4-mapped-IPv6 address.
> Where  /etc/resolv.conf look like this
> =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D
> domain myzone.com
> nameserver 10.53.1.1
> options inet6
> =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D
> gethostbyname2() is working fine when I am giving the hostname that have
> ipv6 address where family parameter in gethostbyname2 is AF_INET6.
> But for the hostname that is having only IPv4 address, where family
> parameter in the gethostbyname2 is AF_INET, according to the man page it
> should return IPv4-mapped-IPv6 address, but gethostbyname2 is returning
> IPv4 address where it should return IPv4-mapped-IPv6 address.
>=20
> Is there any option other than inet6 in the resolv.conf that we have to s=
et
> to get IPv4-mapped- IPv6 address.
> If anyone has face this issue then please tell me.
>=20
> Thanks & Regards,
> Gajanana Dixit
>=20
>=20
>=20
> Confidentiality Notice
> The information contained in this electronic
> message and any attachments to this message are
> intended for the exclusive use of the addressee(s)
> and may contain confidential or privileged information.
> If you are not the intended recipient, please notify
> the sender at Wipro or Mailadmin at wipro.com immediately
> and destroy all copies of this message and any attachments.
>=20
>=20
>



More information about the bind-users mailing list