Route53.Client.
test_dns_answer
(**kwargs)¶Gets the value that Amazon Route 53 returns in response to a DNS request for a specified record name and type. You can optionally specify the IP address of a DNS resolver, an EDNS0 client subnet IP address, and a subnet mask.
This call only supports querying public hosted zones.
See also: AWS API Documentation
Request Syntax
response = client.test_dns_answer(
HostedZoneId='string',
RecordName='string',
RecordType='SOA'|'A'|'TXT'|'NS'|'CNAME'|'MX'|'NAPTR'|'PTR'|'SRV'|'SPF'|'AAAA'|'CAA'|'DS',
ResolverIP='string',
EDNS0ClientSubnetIP='string',
EDNS0ClientSubnetMask='string'
)
[REQUIRED]
The ID of the hosted zone that you want Amazon Route 53 to simulate a query for.
[REQUIRED]
The name of the resource record set that you want Amazon Route 53 to simulate a query for.
[REQUIRED]
The type of the resource record set.
TestDnsAnswer
uses the IP address of a DNS resolver in the Amazon Web Services US East (N. Virginia) Region ( us-east-1
).192.0.2.44
or 2001:db8:85a3::8a2e:370:7334
.If you specify an IP address for edns0clientsubnetip
, you can optionally specify the number of bits of the IP address that you want the checking tool to include in the DNS query. For example, if you specify 192.0.2.44
for edns0clientsubnetip
and 24
for edns0clientsubnetmask
, the checking tool will simulate a request from 192.0.2.0/24. The default value is 24 bits for IPv4 addresses and 64 bits for IPv6 addresses.
The range of valid values depends on whether edns0clientsubnetip
is an IPv4 or an IPv6 address:
dict
Response Syntax
{
'Nameserver': 'string',
'RecordName': 'string',
'RecordType': 'SOA'|'A'|'TXT'|'NS'|'CNAME'|'MX'|'NAPTR'|'PTR'|'SRV'|'SPF'|'AAAA'|'CAA'|'DS',
'RecordData': [
'string',
],
'ResponseCode': 'string',
'Protocol': 'string'
}
Response Structure
(dict) --
A complex type that contains the response to a TestDNSAnswer
request.
Nameserver (string) --
The Amazon Route 53 name server used to respond to the request.
RecordName (string) --
The name of the resource record set that you submitted a request for.
RecordType (string) --
The type of the resource record set that you submitted a request for.
RecordData (list) --
A list that contains values that Amazon Route 53 returned for this resource record set.
(string) --
A value that Amazon Route 53 returned for this resource record set. A RecordDataEntry
element is one of the following:
RecordDataEntry
element contains one value in the resource record set. If the resource record set contains multiple values, the response includes one RecordDataEntry
element for each value.RecordDataEntry
element contains the value from the appropriate resource record set based on the request.RecordDataEntry
element contains an IP address or a domain name for the Amazon Web Services resource, depending on the type of resource.RecordDataEntry
element contains one value from the referenced resource record set. If the referenced resource record set contains multiple values, the response includes one RecordDataEntry
element for each value.ResponseCode (string) --
A code that indicates whether the request is valid or not. The most common response code is NOERROR
, meaning that the request is valid. If the response is not valid, Amazon Route 53 returns a response code that describes the error. For a list of possible response codes, see DNS RCODES on the IANA website.
Protocol (string) --
The protocol that Amazon Route 53 used to respond to the request, either UDP
or TCP
.
Exceptions
Route53.Client.exceptions.NoSuchHostedZone
Route53.Client.exceptions.InvalidInput