DNS look-ups with C++

DNS look-ups with C++

Post by Brian Ferri » Sat, 13 Mar 1999 04:00:00



Hello,

    I am programming a network app that needs to reverse host-name
look-up.  This means that given an IP address x.x.x.x, it needs to be
able to request the registered name associated server from DNS.
    What would be the easiest way to do this?  Is there a function
somewhere that is all ready to go?
    Any information that can be provided is most helpful.

Thanks,
Brian Ferris

 
 
 

DNS look-ups with C++

Post by Claudius Procul » Sat, 13 Mar 1999 04:00:00



>Hello,

>    I am programming a network app that needs to reverse host-name
>look-up.  This means that given an IP address x.x.x.x, it needs to be
>able to request the registered name associated server from DNS.
>    What would be the easiest way to do this?  Is there a function
>somewhere that is all ready to go?
>    Any information that can be provided is most helpful.

FWIW, there can be multiple names for a single address.

John - N8086N
Wise man says "Never use a bank with the initials F. U."
-------------------------------------------
Are you interested in a professional society or
guild for programmers?

See www.programmersguild.org/american.htm
Newsgroup: us.issues.occupations.computer-programmers

EMail Address:


 
 
 

DNS look-ups with C++

Post by Jack Kle » Sat, 13 Mar 1999 04:00:00




Quote:> Hello,

>     I am programming a network app that needs to reverse host-name
> look-up.  This means that given an IP address x.x.x.x, it needs to be
> able to request the registered name associated server from DNS.
>     What would be the easiest way to do this?  Is there a function
> somewhere that is all ready to go?
>     Any information that can be provided is most helpful.

> Thanks,
> Brian Ferris

<Jack>

The standard C++ language does not support networking, so please leave
comp.lang.c++ off your cross post list when asking this type of
question in the future.

</Jack>
--
Do not email me with questions about programming.
Post them to the appropriate newsgroup.
Followups to my posts are welcome.

 
 
 

DNS look-ups with C++

Post by Brian Ferri » Sat, 13 Mar 1999 04:00:00



> The standard C++ language does not support networking, so please leave
> comp.lang.c++ off your cross post list when asking this type of
> question in the future.

    Is this the correct news group at all?  If not, where should I be
posting my question?

Brian Ferris

 
 
 

DNS look-ups with C++

Post by Tim Slatte » Sat, 13 Mar 1999 04:00:00



>Hello,

>    I am programming a network app that needs to reverse host-name
>look-up.  This means that given an IP address x.x.x.x, it needs to be
>able to request the registered name associated server from DNS.
>    What would be the easiest way to do this?  Is there a function
>somewhere that is all ready to go?
>    Any information that can be provided is most helpful.

>Thanks,
>Brian Ferris

If you are developing for Windows, you need to check out the winsock
API.

--
Tim Slattery

 
 
 

DNS look-ups with C++

Post by Malwar » Sun, 14 Mar 1999 04:00:00


Hi Brian,


>     I am programming a network app that needs to reverse host-name
> look-up.  This means that given an IP address x.x.x.x, it needs to be
> able to request the registered name associated server from DNS.
>     What would be the easiest way to do this?  Is there a function
> somewhere that is all ready to go?

As you are posting this question to a Linux group too I suppose you want
a sulution running under Linux.
You can use the C-functions provided. There is a function gethostbyaddr.
Type in "man 3 gethostbyaddr" for more information about. You might want
to read "Unix Network Programming - Volume 1" by R.W.Stevens (ISBN
0-13-490012-X). This is all for C though. There might be C++ libraries
arround that offer this functions wrapped into a object or you might
write one yourself.

Malware