Abstract: This page describes the Java interface NetAddressNameService of the silvertunnel-ng.org Netlib API.
The NetAddressNameService is the general interface to all name service implementations provided by silvertunnel-ng.org [Netlib].
All currently available implementations encapsulate access to the Doman Name System (DNS), other implementations are possible using the same API. The implementations provide two kind of mappings:
interface org.silvertunnel_ng.netlib.api.NetAddressNameService definition:
public interface NetAddressNameService {
/*
* Resolve the (IP) address(es) from the (host) name.
*
* E.g. DNS lookup.
*
* @param name (host) name to lookup
* @return one or more addresses that match;
* ordered by relevance, i.e. prefer to use the first element of the array
* @throws UnknownHostException if the resolution failed
/
NetAddress[] getAddressesByName(String name) throws UnknownHostException;<span class="cm">/** * Resolve the (host) name of an (IP) address. * * E.g. DNS reverse lookup. * * @param address (IP) address to lookup. * @return one or more names that match; * ordered by relevance, i.e. prefer to use the first element of the array * @throws UnknownHostException if the resolution failed */</span> String<span class="o">[]</span> <span class="nf">getNamesByAddress</span><span class="o">(</span>NetAddress address<span class="o">)</span> <span class="kd">throws</span> UnknownHostException<span class="o">;</span>}
interface NetAddress an its implementations are described on an extra page: Netlib NetAddress
One important point in anonymous communication is to control DNS request. It is important that DNS requests related to the anonymous communication are NOT sent to the local DNS server - otherwise these unsecured DNS requests could be used to analyse the anonymous communication.
Therefore, we provide NetAddressNameService implementation that tunnels DNS requests through the [Tor] network to avoid such problems.
Two ways are possible:
(typical:) retrieve the NetAddressNameService implementation that belongs to a NetLayer:
NetLayer myNetLayer = ...;
NetAddressNameService myNetAddressNameService = myNetLayer.getNetAddressNameService();
Top: [Netlib], Next: [Netlib NetAddressNameService Implementations]
Wiki: Netlib Adapters
Wiki: Netlib Name Service Adapter
Wiki: Netlib NetAddressNameService Implementations
Wiki: Netlib TorNetLayer
Wiki: Netlib