Route53 / Client / test_dns_answer

test_dns_answer#

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.

Note

The TestDnsAnswer returns information similar to what you would expect from the answer section of the dig command. Therefore, if you query for the name servers of a subdomain that point to the parent name servers, those will not be returned.

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'
)
Parameters:
  • HostedZoneId (string) –

    [REQUIRED]

    The ID of the hosted zone that you want Amazon Route 53 to simulate a query for.

  • RecordName (string) –

    [REQUIRED]

    The name of the resource record set that you want Amazon Route 53 to simulate a query for.

  • RecordType (string) –

    [REQUIRED]

    The type of the resource record set.

  • ResolverIP (string) – If you want to simulate a request from a specific DNS resolver, specify the IP address for that resolver. If you omit this value, TestDnsAnswer uses the IP address of a DNS resolver in the Amazon Web Services US East (N. Virginia) Region ( us-east-1).

  • EDNS0ClientSubnetIP (string) – If the resolver that you specified for resolverip supports EDNS0, specify the IPv4 or IPv6 address of a client in the applicable location, for example, 192.0.2.44 or 2001:db8:85a3::8a2e:370:7334.

  • EDNS0ClientSubnetMask (string) –

    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:

    • IPv4: Specify a value between 0 and 32

    • IPv6: Specify a value between 0 and 128

Return type:

dict

Returns:

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:

        • For non-alias resource record sets, a 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.

        • For multiple resource record sets that have the same name and type, which includes weighted, latency, geolocation, and failover, a RecordDataEntry element contains the value from the appropriate resource record set based on the request.

        • For alias resource record sets that refer to Amazon Web Services resources other than another resource record set, the RecordDataEntry element contains an IP address or a domain name for the Amazon Web Services resource, depending on the type of resource.

        • For alias resource record sets that refer to other resource record sets, a 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