Class DnsMessageTransport
java.lang.Object
google.registry.dns.writer.dnsupdate.DnsMessageTransport
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 Summary
ConstructorDescriptionDnsMessageTransport
(SocketFactory factory, String updateHost, org.joda.time.Duration updateTimeout) Class constructor. -
Method Summary
Modifier and TypeMethodDescriptionorg.xbill.DNS.Message
send
(org.xbill.DNS.Message query) Sends a DNS "query" message (most likely an UPDATE) and returns the response.
-
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 socketsupdateHost
- host name of the DNS serverupdateTimeout
- update I/O timeout
-
-
Method Details
-
send
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 oneIllegalArgumentException
- if the query is too large to be sent (> 65535 bytes)
-