Skip to content
Get Started for Free

Route 53 Resolver

Route 53 Resolver allows you to route DNS queries between your virtual private cloud (VPC) and your network. Route 53 Resolver forwards DNS queries for domain names to the appropriate DNS service based on the configuration you set up. Route 53 Resolver can be used to resolve domain names between your VPC and your network, and to resolve domain names between your VPCs.

LocalStack allows you to use the Route 53 Resolver endpoints in your local environment. The supported APIs are available on our API Coverage section, which provides information on the extent of Route 53 Resolver’s integration with LocalStack.

This guide is designed for users new to Route53 Resolver and assumes basic knowledge of the AWS CLI and our lstk aws command.

Start your LocalStack container using your preferred method. We will demonstrate how to create a resolver endpoint, list the endpoints, and delete the endpoint with the AWS CLI.

Fetch the IP addresses & Security Group ID

Section titled “Fetch the IP addresses & Security Group ID”

Fetch the default VPC ID using the following command:

Terminal window
VPC_ID=$(lstk aws ec2 describe-vpcs --query 'Vpcs[?IsDefault==`true`].VpcId' --output text)

Fetch the default VPC’s security group ID using the following command:

Terminal window
lstk aws ec2 describe-subnets --filters Name=vpc-id,Values=$VPC_ID --query 'Subnets[].SubnetId'
Output
[
"subnet-bdd58a47",
"subnet-957d6ba6",
"subnet-3f8669d3",
"subnet-ec2a41c6",
"subnet-3d583924",
"subnet-8c1b0af8"
]

Choose two subnets from the list above and fetch the CIDR block of the subnets which tells you the range of IP addresses within it. Let’s fetch the CIDR block of the subnet subnet-957d6ba6:

Terminal window
lstk aws ec2 describe-subnets --subnet-ids subnet-957d6ba6 --query 'Subnets[*].CidrBlock'
Output
[
"172.31.16.0/20"
]

Similarly, fetch the CIDR block of the subnet subnet-bdd58a47:

Terminal window
lstk aws ec2 describe-subnets --subnet-ids subnet-bdd58a47 --query 'Subnets[*].CidrBlock'
Output
[
"172.31.0.0/20"
]

Save the CIDR blocks of the subnets as you will need them later. Lastly fetch the security group ID of the default VPC:

Terminal window
lstk aws ec2 describe-security-groups \
--filters Name=vpc-id,Values=$VPC_ID \
--query 'SecurityGroups[0].GroupId'
Output
sg-39936e572e797b360

Save the security group ID as you will need it later.

Create a new file named create-outbound-resolver-endpoint.json and add the following content:

{
"CreatorRequestId": "2020-01-01-18:47",
"Direction": "OUTBOUND",
"IpAddresses": [
{
"Ip": "172.31.0.0",
"SubnetId": "subnet-bdd58a47"
},
{
"Ip": "172.31.16.0",
"SubnetId": "subnet-957d6ba6"
}
],
"Name": "my-outbound-endpoint",
"SecurityGroupIds": [ "sg-39936e572e797b360" ],
"Tags": [
{
"Key": "purpose",
"Value": "test"
}
]
}

Replace the Ip and SubnetId values with the CIDR blocks and subnet IDs you fetched earlier.

You can now use the CreateResolverEndpoint API to create an outbound resolver endpoint. Run the following command:

Terminal window
lstk aws route53resolver create-resolver-endpoint \
--cli-input-json file://create-outbound-resolver-endpoint.json
Output
{
"ResolverEndpoint": {
"Id": "rslvr-out-5d61abaff9de06b99",
"CreatorRequestId": "2020-01-01-18:47",
"Arn": "arn:aws:route53resolver:us-east-1:000000000000:resolver-endpoint/rslvr-out-5d61abaff9de06b99",
"Name": "my-outbound-endpoint",
"SecurityGroupIds": [
"sg-39936e572e797b360"
],
"Direction": "OUTBOUND",
"IpAddressCount": 2,
"HostVPCId": "vpc-d78cf7bb",
"Status": "CREATING",
"StatusMessage": "[Trace id: 1-bf9fe209-b90acae7cbcefe68a98b2882] Successfully created Resolver Endpoint",
"CreationTime": "2024-05-02T15:03:17.266471+00:00",
"ModificationTime": "2024-05-02T15:03:17.266491+00:00"
}
}

You can list the resolver endpoints using the ListResolverEndpoints API. Run the following command:

Terminal window
lstk aws route53resolver list-resolver-endpoints
Output
{
"ResolverEndpoints": [
{
"Id": "rslvr-out-5d61abaff9de06b99",
"CreatorRequestId": "2020-01-01-18:47",
"Arn": "arn:aws:route53resolver:us-east-1:000000000000:resolver-endpoint/rslvr-out-5d61abaff9de06b99",
"Name": "my-outbound-endpoint",
"SecurityGroupIds": [
"sg-39936e572e797b360"
],
"Direction": "OUTBOUND",
"IpAddressCount": 2,
"HostVPCId": "vpc-d78cf7bb",
"Status": "OPERATIONAL",
"StatusMessage": "[Trace id: 1-bf9fe209-b90acae7cbcefe68a98b2882] Successfully created Resolver Endpoint",
"CreationTime": "2024-05-02T15:03:17.266471+00:00",
"ModificationTime": "2024-05-02T15:03:17.266491+00:00"
}
],
"MaxResults": 10
}

You can delete the resolver endpoint using the DeleteResolverEndpoint API. Run the following command:

Terminal window
lstk aws route53resolver delete-resolver-endpoint \
--resolver-endpoint-id rslvr-out-5d61abaff9de06b99

Replace rslvr-out-5d61abaff9de06b99 with the ID of the resolver endpoint you want to delete.

The LocalStack Web Application provides a Route53 Resolver for creating and managing resolver endpoints. You can access the Resource Browser by opening the LocalStack Web Application in your browser, navigating to the Resource Browser section, and then clicking on Route53 under the Analytics section. Navigate to the Resolver Endpoints tab to view the resolver endpoints.

Route53Resolver Resource Browser

The Resource Browser allows you to perform the following actions:

  • Create resolver endpoint: Create a resolver endpoint by clicking on the Create Endpoint button. This will open a modal where you can enter the name, VPC, and other parameters and click on the Submit button to create the resolver endpoint.
  • View resolver endpoint: View the details of a resolver endpoint by clicking on the specific resolver endpoint name. This will open a modal where you can view the resolver endpoint details.
  • Edit resolver endpoint: Edit the details of a resolver endpoint by clicking on the Edit Endpoint button in the specific resolver endpoint page. This will open a modal where you can edit the resolver endpoint details.
  • Delete resolver endpoint: Select the resolver endpoints you want to delete by clicking on the checkbox next to the resolver endpoint name, followed by clicking on the Actions button and then clicking on Remove Selected.

51 of 72 operations implemented

Available from the Hobby plan. Licensing details

Find an API

Search the full operation list, then sort the table to compare current support.

Loading operations…

Verified on Kubernetes
Loading operations…
Complete static API list All 72 operations and their current support status
OperationStatus
AssociateFirewallRuleGroupImplemented
AssociateResolverEndpointIpAddressImplemented
AssociateResolverQueryLogConfigImplemented
AssociateResolverRuleImplemented
BatchCreateFirewallRuleNot implemented
BatchDeleteFirewallRuleNot implemented
BatchUpdateFirewallRuleNot implemented
CreateFirewallDomainListImplemented
CreateFirewallRuleImplemented
CreateFirewallRuleGroupImplemented
CreateOutpostResolverNot implemented
CreateResolverEndpointImplemented
CreateResolverQueryLogConfigImplemented
CreateResolverRuleImplemented
DeleteFirewallDomainListImplemented
DeleteFirewallRuleImplemented
DeleteFirewallRuleGroupImplemented
DeleteOutpostResolverNot implemented
DeleteResolverEndpointImplemented
DeleteResolverQueryLogConfigImplemented
DeleteResolverRuleImplemented
DisassociateFirewallRuleGroupImplemented
DisassociateResolverEndpointIpAddressImplemented
DisassociateResolverQueryLogConfigImplemented
DisassociateResolverRuleImplemented
GetFirewallConfigImplemented
GetFirewallDomainListImplemented
GetFirewallRuleGroupImplemented
GetFirewallRuleGroupAssociationImplemented
GetFirewallRuleGroupPolicyNot implemented
GetOutpostResolverNot implemented
GetResolverConfigNot implemented
GetResolverDnssecConfigImplemented
GetResolverEndpointImplemented
GetResolverQueryLogConfigImplemented
GetResolverQueryLogConfigAssociationImplemented
GetResolverQueryLogConfigPolicyNot implemented
GetResolverRuleImplemented
GetResolverRuleAssociationImplemented
GetResolverRulePolicyNot implemented
ImportFirewallDomainsNot implemented
ListFirewallConfigsImplemented
ListFirewallDomainListsImplemented
ListFirewallDomainsImplemented
ListFirewallRuleGroupAssociationsNot implemented
ListFirewallRuleGroupsImplemented
ListFirewallRuleTypesNot implemented
ListFirewallRulesImplemented
ListOutpostResolversNot implemented
ListResolverConfigsNot implemented
ListResolverDnssecConfigsImplemented
ListResolverEndpointIpAddressesImplemented
ListResolverEndpointsImplemented
ListResolverQueryLogConfigAssociationsImplemented
ListResolverQueryLogConfigsImplemented
ListResolverRuleAssociationsImplemented
ListResolverRulesImplemented
ListTagsForResourceImplemented
PutFirewallRuleGroupPolicyNot implemented
PutResolverQueryLogConfigPolicyNot implemented
PutResolverRulePolicyNot implemented
TagResourceImplemented
UntagResourceImplemented
UpdateFirewallConfigImplemented
UpdateFirewallDomainsImplemented
UpdateFirewallRuleImplemented
UpdateFirewallRuleGroupAssociationImplemented
UpdateOutpostResolverNot implemented
UpdateResolverConfigNot implemented
UpdateResolverDnssecConfigImplemented
UpdateResolverEndpointImplemented
UpdateResolverRuleNot implemented
Was this page helpful?