public class SOAextends Data
DNS SOA (Start of Authority) record payload.
Contains authoritative information about a DNS zone including primary nameserver, admin email, and timing parameters.
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    final int
    A 32 bit time value that specifies the upper limit on the time interval that can elapse before the zone is no longer authoritative.
    final long
    The unsigned 32 bit minimum TTL field that should be exported with any RR from this zone.
    final DnsName
    The domain name of the name server that was the original or primary source of data for this zone.
    final int
    A 32 bit time interval before the zone should be refreshed.
    final int
    A 32 bit time interval that should elapse before a failed refresh should be retried.
    final DnsName
    A domain name which specifies the mailbox of the person responsible for this zone.
    final long
    The unsigned 32 bit version number of the original copy of the zone.
  • Constructor Summary

    Constructors
    Constructor
    Description
    SOA(String mname, String rname, long serial, int refresh, int retry, int expire, long minimum)
    Create an SOA record from names in presentation form.
    SOA(DnsName mname, DnsName rname, long serial, int refresh, int retry, int expire, long minimum)
    Create an SOA record from already parsed names.
  • Method Summary

    Modifier and Type
    Method
    Description
    Return the record type of this payload.
    static SOA
    parse(DataInputStream dis, byte[] data)
    Parse an SOA record payload from a DNS message.
    void
    Write the seven authority fields to a DNS output stream.
    Return the zone's authority data in presentation format.

    Methods inherited from class Data

    equals, hashCode, length, toByteArray, toOutputStream, toOutputStream
    Modifier and Type
    Method
    Description
    final boolean
    equals(Object other)
     
    final int
     
    final int
    Serialize this record, if that has not been done already, and report the resulting wire size.
    final byte[]
    Serialize this record, if that has not been done already, and return a copy of the result so callers cannot mutate the cached bytes.
    final void
    Write the binary representation of this payload to the given DataOutputStream.
    final void
    Write the binary representation to the given OutputStream.

    Methods inherited from class Object

    clone, getClass, notify, notifyAll, wait, wait, wait
  • Field Details

    • mname

      public final DnsName mname
      The domain name of the name server that was the original or primary source of data for this zone.
    • rname

      public final DnsName rname
      A domain name which specifies the mailbox of the person responsible for this zone.
    • serial

      public final long serial
      The unsigned 32 bit version number of the original copy of the zone. Zone transfers preserve this value. This value wraps and should be compared using sequence space arithmetic.
    • refresh

      public final int refresh
      A 32 bit time interval before the zone should be refreshed.
    • retry

      public final int retry
      A 32 bit time interval that should elapse before a failed refresh should be retried.
    • expire

      public final int expire
      A 32 bit time value that specifies the upper limit on the time interval that can elapse before the zone is no longer authoritative.
    • minimum

      public final long minimum
      The unsigned 32 bit minimum TTL field that should be exported with any RR from this zone.
  • Constructor Details

    • SOA

      public SOA(String mname, String rname, long serial, int refresh, int retry, int expire, long minimum)
      Create an SOA record from names in presentation form.
      Parameters:
      mname - the primary nameserver for the zone, in presentation form
      rname - the mailbox of the zone administrator, in presentation form
      serial - the unsigned 32 bit version number of the zone copy
      refresh - seconds to wait before the zone should be refreshed
      retry - seconds to wait before a failed refresh is retried
      expire - seconds after which the zone is no longer authoritative
      minimum - the unsigned 32 bit minimum TTL exported with any RR from the zone
    • SOA

      public SOA(DnsName mname, DnsName rname, long serial, int refresh, int retry, int expire, long minimum)
      Create an SOA record from already parsed names.
      Parameters:
      mname - the primary nameserver for the zone
      rname - the mailbox of the zone administrator
      serial - the unsigned 32 bit version number of the zone copy
      refresh - seconds to wait before the zone should be refreshed
      retry - seconds to wait before a failed refresh is retried
      expire - seconds after which the zone is no longer authoritative
      minimum - the unsigned 32 bit minimum TTL exported with any RR from the zone
  • Method Details

    • parse

      public static SOA parse(DataInputStream dis, byte[] data) throws IOException
      Parse an SOA record payload from a DNS message.
      Parameters:
      dis - the stream positioned at the start of the SOA record payload
      data - the raw DNS message data, needed to resolve compressed names
      Returns:
      the parsed SOA record
      Throws:
      IOException - on parse error
    • getType

      public Record.TYPE getType()
      Return the record type of this payload.
      Specified by:
      getType in class Data
      Returns:
      The DNS record type of this payload.
    • serialize

      public void serialize(DataOutputStream dos) throws IOException
      Write the seven authority fields to a DNS output stream.
      Specified by:
      serialize in class Data
      Parameters:
      dos - the output stream to serialize to.
      Throws:
      IOException - if an I/O error occurs.
    • toString

      public String toString()
      Return the zone's authority data in presentation format.
      Overrides:
      toString in class Object