public class Aextends InternetAddressRR<Inet4Address>
DNS A record payload representing an IPv4 address.
Maps a domain name to an IPv4 address, the most common DNS record type.
  • Constructor Details

    • A

      public A(Inet4Address inet4Address)
      Create A record from IPv4 address.
      Parameters:
      inet4Address - the IPv4 address
    • A

      public A(int q1, int q2, int q3, int q4)
      Create A record from four octets.
      Parameters:
      q1 - the most significant octet, 0-255; another value throws
      q2 - the next octet, 0-255; another value throws
      q3 - the next octet, 0-255; another value throws
      q4 - the least significant octet, 0-255; another value throws
    • A

      public A(byte[] ip)
      Create A record from byte array.
      Parameters:
      ip - byte array containing IPv4 address (must be 4 bytes)
    • A

      public A(CharSequence ipv4CharSequence)
      Create A record from character sequence.
      Parameters:
      ipv4CharSequence - character sequence containing IPv4 address
  • Method Details

    • getType

      public Record.TYPE getType()
      Description copied from class: Data
      The payload type.
      Specified by:
      getType in class Data
      Returns:
      The DNS record type of this payload.
    • parse

      public static A parse(DataInputStream dis) throws IOException
      Parse A record from data input stream.
      Parameters:
      dis - data input stream to read from
      Returns:
      parsed A record
      Throws:
      IOException - if I/O error occurs
    • toString

      public String toString()
      Overrides:
      toString in class Object