/* resolv.c: DNS Resolver
*
* Copyright (C) 1998 Kenneth Albanowski <kjahds@kjahds.com>,
* The Silver Hammer Group, Ltd.
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Library General Public
* License as published by the Free Software Foundation; either
* version 2 of the License, or (at your option) any later version.
*
* 5-Oct-2000 W. Greathouse wgreathouse@smva.com
* Fix memory leak and memory corruption.
* -- Every name resolution resulted in
* a new parse of resolv.conf and new
* copy of nameservers allocated by
* strdup.
* -- Every name resolution resulted in
* a new read of resolv.conf without
* resetting index from prior read...
* resulting in exceeding array bounds.
*
* Limit nameservers read from resolv.conf
*
* Add "search" domains from resolv.conf
*
* Some systems will return a security
* signature along with query answer for
* dynamic DNS entries.
* -- skip/ignore this answer
*
* Include arpa/nameser.h for defines.
*
* General cleanup
*
* 20-Jun-2001 Michal Moskal <malekith@pld.org.pl>
* partial IPv6 support (i.e. gethostbyname2() and resolve_address2()
* functions added), IPv6 nameservers are also supported.
*
* 6-Oct-2001 Jari Korva <jari.korva@iki.fi>
* more IPv6 support (IPv6 support for gethostbyaddr();
* address family parameter and improved IPv6 support for get_hosts_byname
* and read_etc_hosts; getnameinfo() port from glibc; defined
* defined ip6addr_any and in6addr_loopback)
*
* 2-Feb-2002 Erik Andersen <andersee@debian.org>
* Added gethostent(), sethostent(), and endhostent()
*
*/
#define __FORCE_GLIBC
#include <features.h>
#include <string.h>
#include <stdio.h>
#include <signal.h>
#include <errno.h>
#include <sys/socket.h>
#include <sys/types.h>
#include <netinet/in.h>
#include <arpa/inet.h>
#include <stdlib.h>
#include <unistd.h>
#include <resolv.h>
#include <netdb.h>
#include <ctype.h>
#incl
|