Opens in a new tab

Reverse DNS on Amazon EC2: setting the PTR record

On Amazon EC2, reverse DNS is set on an Elastic IP — Actions, Update reverse DNS — once an A record for the name already points to it. Outbound port 25 is blocked until you ask AWS to lift it, and the same form can set the PTR too.

ProviderAmazon EC2 — Cloud provider
WhereElastic IPs → Update reverse DNS
Before you set itAn Elastic IP, and the A record first
Takes effectPending until applied; no time is stated
IPv6Only through an AWS Support case, with proof of domain ownership
Outbound port 25Blocked until you ask
Default nameec2-203-0-113-25.compute-1.amazonaws.com

Is reverse DNS right for your Amazon EC2 server?

Enter the IP address the server sends mail from, or its host name: we look up its PTR record, check that the name leads back to the address, and say whether it is still the default.

Setting reverse DNS at Amazon EC2

  1. Create an A record for the name (mail.example.com) pointing to an Elastic IP in your account — first.
  2. EC2 console, Elastic IPs, select the address, Actions, Update reverse DNS; enter the name, type “update” and confirm.

With the AWS CLI:

aws ec2 modify-address-attribute --allocation-id eipalloc-0123456789abcdef0 --domain-name mail.example.com

Before you set it

  • An Elastic IP — an automatically assigned public address cannot carry a custom PTR.
  • The A record, already resolving to that Elastic IP.

Sending mail on port 25

EC2 blocks outbound port 25 to the internet by default. Ask for it to be lifted with the “Request to remove email sending limitations” form — one per Region, with your use case and anti-abuse plan; it can also set the reverse DNS for you. It can take up to 48 hours.

Worth knowing

An Elastic IP with a PTR is locked to your account: it cannot be released until the record is removed.

What changed

  • 1 February 2024 — Every public IPv4 address, Elastic IPs included, costs $0.005 an hour.

Sources

Checked on 27 September 2026 against these official sources:

Keep your sending servers off the blocklists

Add your domain and we check the servers you send from every day — reverse DNS, blocklists and authentication — and email you when one is listed or a record breaks. Free for your first domain.

Create a free account