| java.lang.Object CustomDNS.VirtualDNS.VirtualDNS
All known Subclasses: CustomDNS.ESpeakDNS,
VirtualDNS | public class VirtualDNS (Code) | | A very restricted DNS server which supports a single virtual domain.
This DNS server only supports one zone. It refuses all queries for
information outside that zone. It doesn't support zone transfers,
subzones or referrals.
The names in the zone are divided into two categories: static and
dynamic. The static names are served from the specified master file.
The dynamic names are supplied by subclasses (which should override
findDynamicData).
This class is based on jnamed by
Brian Wellington <bwelling@xbill.org>.
|
Constructor Summary | |
public | VirtualDNS(String zonefile) Create and run a new DNS server on port 53. | public | VirtualDNS(String zonefile, short port) Create and run a new DNS server. |
Method Summary | |
protected SetResponse | findDynamicData(Name zoneName, Name queryName, short queryType) Look up dynamic DNS data for a given hostname.
Override this method to return either a valid SetResponse for the
given name, or null (to decline). | public static void | main(String[] args) Test this class.
A simple test program allowing the VirtualDNS to be run by
itself. |
VirtualDNS | public VirtualDNS(String zonefile) throws IOException(Code) | | Create and run a new DNS server on port 53.
Parameters: zonefile - A master file for the zone to serve. |
VirtualDNS | public VirtualDNS(String zonefile, short port) throws IOException(Code) | | Create and run a new DNS server.
Parameters: zonefile - A master file for the zone to serve. Parameters: port - The port on which to run the server. |
findDynamicData | protected SetResponse findDynamicData(Name zoneName, Name queryName, short queryType)(Code) | | Look up dynamic DNS data for a given hostname.
Override this method to return either a valid SetResponse for the
given name, or null (to decline). You probably don't want to return
any records that will require glue (MX, CNAME, etc.).
XXX - Fix this to use an RRset. This will require refactoring other
code.
Parameters: zoneName - The DNS name of the zone containing the host. Parameters: queryName - The DNS name of the host. Parameters: queryType - The type of records to return. A SetResponse containing the records an error code. See Also: org.xbill.DNS.SetResponse |
main | public static void main(String[] args)(Code) | | Test this class.
A simple test program allowing the VirtualDNS to be run by
itself. Pass it a regular DNS master file.
Parameters: args - Command-line arguments. |
|
|