• Welcome to Valhalla Legends Archive.
 

DNS domain to ip chain, Seeking help - C++

Started by LordVader, August 19, 2005, 02:16 AM

Previous topic - Next topic

LordVader

Have an idea for a  handy util for bots or any client application that connects to servers, but im unsure of the core functions that i'd need.. any idea's welcome..

Core program would do the following:
Input Domain(or ip), then dns the domain/ip then store the results in ini under:

[server=<domain>]
<domain>ip0=127.0.0.1
<domain>ip1=127.0.0.2
<domain>ip2=127.0.0.3

or similar etc..

basic socket/connecting, and config writing, is no big deal can manage that..
Mainly curious about methods|ideas to retrieve ipchains from say useast.battle.net etc..

UserLoser.

#1
Quote from: LordVader on August 19, 2005, 02:16 AM
Have an idea for a  handy util for bots or any client application that connects to servers, but im unsure of the core functions that i'd need.. any idea's welcome..

Core program would do the following:
Input Domain(or ip), then dns the domain/ip then store the results in ini under:

[server=<domain>]
<domain>ip0=127.0.0.1
<domain>ip1=127.0.0.2
<domain>ip2=127.0.0.3

or similar etc..

basic socket/connecting, and config writing, is no big deal can manage that..
Mainly curious about methods|ideas to retrieve ipchains from say useast.battle.net etc..

gethostbyname.  Loop through h_addr_list of your hostent structure, use inet_ntoa to convert it into a more readable format, and finally using whatever method you wish, write the ini file.

LordVader

Quote from: UserLoser on August 19, 2005, 06:48 AM
gethostbyname.  Loop through h_addr_list of your hostent structure, use inet_ntoa to convert it into a more readable format, and finally using whatever method you wish, write the ini file.

Brainfart on my part, didn't look at  h_addr_list in gethostbyname, inet_ntoa looks handy will probably use that thx UL

*General Note:
For ip dns can use: gethostbyaddr then gethostbyname can be used.

Kp

Note that inet_ntoa is deprecated in favor of the more versatile inet_ntop.
[19:20:23] (BotNet) <[vL]Kp> Any idiot can make a bot with CSB, and many do!

UserLoser.

Quote from: Kp on August 19, 2005, 05:06 PM
Note that inet_ntoa is deprecated in favor of the more versatile inet_ntop.

Pretty sure he's using Windows though :P

Kp

Quote from: UserLoser on August 19, 2005, 11:41 PM
Quote from: Kp on August 19, 2005, 05:06 PMNote that inet_ntoa is deprecated in favor of the more versatile inet_ntop.
Pretty sure he's using Windows though :P

Note that Windows is deprecated in favor of a more POSIX-compliant OS. ;)
[19:20:23] (BotNet) <[vL]Kp> Any idiot can make a bot with CSB, and many do!