round robin dns's and ip addresses

yawnmoth terra1024 at yahoo.com
Mon Aug 15 06:17:06 UTC 2005


Kevin Darcy wrote:
> yawnmoth wrote:
>
> <snip>
>
> What OS are you using? On all (Unix-like) OSes I know, gethostbyname()
> returns a struct hostent, which contains a *list* of IP addresses, not
> just a single address, e.g.
>
>     struct hostent {
>          char    *h_name;         /* canonical name of host */
>          char    **h_aliases;     /* alias list */
>          int     h_addrtype;      /* host address type */
>          int     h_length;        /* length of address */
>          char    **h_addr_list;   /* list of addresses */
>      };
>
> Failing that, use Perl and the Net::DNS module, which makes it fairly
> trivial to find all of the A records (just loop through all the "rr"
> objects in the "answer" array, which is a member of the "packet" object
> that was returned by your query, looking for ones with "type" set to "A").

The problem was actually a mistake on my part...  I made a typo when
typing the domain name in...  :/



More information about the bind-users mailing list