Ethereal-dev: Re: [Ethereal-dev] [Patch] Name resolution from "hosts" file

Note: This archive is from the project's previous web site, ethereal.com. This list is no longer active.

From: Guy Harris <gharris@xxxxxxxxx>
Date: Wed, 17 Nov 2004 00:37:12 -0800
Francisco Alcoba (TS/EEM) wrote:

When using Asynchronous DNS, the names from the "hosts" file are not used
in name resolution. With code borrowed from the preferences file parsing,
the patch reads, at startup time, the names and addresses from the file
and stores them.

I've checked in a variant that uses code borrowed from the "epan/addr_resolv.c" code to read the ethers file. It also "handles" IPv6 addresses in the hosts file by ignoring them.

The ADNS resolution code, and the code to read the hosts file, should probably be modified to handle IPv6 addresses.

I have tested this only in Windows, but I don't think it should be very
different in other systems -other than having different locations for the
hosts file, of which I am not sure-.

All UN*Xes should keep it in "/etc/hosts"; I tested it with some debugging code (as I don't build with ADNS), and it appears to correctly read the hosts file on my machine.