Class DnsMessageTransport

java.lang.Object
google.registry.dns.writer.dnsupdate.DnsMessageTransport

public class DnsMessageTransport extends Object
A transport for DNS messages. Sends/receives DNS messages over TCP using old-style Socket s and the message framing defined in RFC 1035. We would like use the dnsjava library's SimpleResolver class for this, but it requires SocketChannel which is not supported on AppEngine.
  • Constructor Details

    • DnsMessageTransport

      @Inject public DnsMessageTransport(SocketFactory factory, @Config("dnsUpdateHost") String updateHost, @Config("dnsUpdateTimeout") org.joda.time.Duration updateTimeout)
      Class constructor.
      Parameters:
      factory - a factory for TCP sockets
      updateHost - host name of the DNS server
      updateTimeout - update I/O timeout
  • Method Details

    • send

      public org.xbill.DNS.Message send(org.xbill.DNS.Message query) throws IOException
      Sends a DNS "query" message (most likely an UPDATE) and returns the response. The response is checked for matching ID and opcode.
      Parameters:
      query - a message to send
      Returns:
      the response received from the server
      Throws:
      IOException - if the Socket input/output streams throws one
      IllegalArgumentException - if the query is too large to be sent (> 65535 bytes)