Package org.xbill.DNS

Class ReverseMap

java.lang.Object
org.xbill.DNS.ReverseMap

public final class ReverseMap extends Object
A set of functions designed to deal with DNS names used in reverse mappings. For the IPv4 address a.b.c.d, the reverse map name is d.c.b.a.in-addr.arpa. For an IPv6 address, the reverse map name is ...ip6.arpa.
Author:
Brian Wellington
  • Method Summary

    Modifier and Type
    Method
    Description
    static Name
    fromAddress(byte[] addr)
    Creates a reverse map name corresponding to an address contained in an array of 4 bytes (for an IPv4 address) or 16 bytes (for an IPv6 address).
    static Name
    fromAddress(int[] addr)
    Creates a reverse map name corresponding to an address contained in an array of 4 integers between 0 and 255 (for an IPv4 address) or 16 integers between 0 and 255 (for an IPv6 address).
    static Name
    Creates a reverse map name corresponding to an address contained in a String.
    static Name
    fromAddress(String addr, int family)
    Creates a reverse map name corresponding to an address contained in a String.
    static Name
    Creates a reverse map name corresponding to an address contained in an InetAddress.
    Parses the address from a reverse map string.
    fromName(Name name)
    Parses the address from a reverse map name.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Method Details

    • fromAddress

      public static Name fromAddress(byte[] addr)
      Creates a reverse map name corresponding to an address contained in an array of 4 bytes (for an IPv4 address) or 16 bytes (for an IPv6 address).
      Parameters:
      addr - The address from which to build a name.
      Returns:
      The name corresponding to the address in the reverse map.
    • fromAddress

      public static Name fromAddress(int[] addr)
      Creates a reverse map name corresponding to an address contained in an array of 4 integers between 0 and 255 (for an IPv4 address) or 16 integers between 0 and 255 (for an IPv6 address).
      Parameters:
      addr - The address from which to build a name.
      Returns:
      The name corresponding to the address in the reverse map.
    • fromAddress

      public static Name fromAddress(InetAddress addr)
      Creates a reverse map name corresponding to an address contained in an InetAddress.
      Parameters:
      addr - The address from which to build a name.
      Returns:
      The name corresponding to the address in the reverse map.
    • fromAddress

      public static Name fromAddress(String addr, int family) throws UnknownHostException
      Creates a reverse map name corresponding to an address contained in a String.
      Parameters:
      addr - The address from which to build a name.
      Returns:
      The name corresponding to the address in the reverse map.
      Throws:
      UnknownHostException - The string does not contain a valid address.
    • fromAddress

      public static Name fromAddress(String addr) throws UnknownHostException
      Creates a reverse map name corresponding to an address contained in a String.
      Parameters:
      addr - The address from which to build a name.
      Returns:
      The name corresponding to the address in the reverse map.
      Throws:
      UnknownHostException - The string does not contain a valid address.
    • fromName

      public static InetAddress fromName(String name) throws UnknownHostException, TextParseException
      Parses the address from a reverse map string.
      Parameters:
      name - The string from which to build an address.
      Returns:
      The address corresponding to the reverse map string.
      Throws:
      UnknownHostException - the passed name is not a valid reverse map.
      TextParseException
      Since:
      3.1
    • fromName

      public static InetAddress fromName(Name name) throws UnknownHostException
      Parses the address from a reverse map name.
      Parameters:
      name - The name from which to build an address.
      Returns:
      The address corresponding to the reverse map name.
      Throws:
      UnknownHostException - the passed name is not a valid reverse map.
      Since:
      3.1