Skip to content
Switch branches/tags

Latest commit


Git stats


Failed to load latest commit information.
Latest commit message
Commit time


awsautodns is a tool that allows an AWS EC2 Instance to automatically register it's IP address in a Route53 Hosted Zone at startup. The install script creates a oneshot service, awsautodns.service, and sets it to start at boot, by installing it to

awsautodns is useful for avoiding fees associated with using an elastic IP address.


awsautodns has been tested to work on both ARM64 and x86-64 on the following Linux distros:

  • Amazon Linux 2
  • Ubuntu Server 16/18/20.04 LTS
  • Red Hat Enterprise Linux 8


awsautodns has several dependencies for installation.

  • net-tools
  • aws-cli
  • gcc
  • make
  • git

Once installed, awsautodns has only 2 dependencies.

  • net-tools
  • aws-cli


awsautodns configures itself by reading tags associated with the instance. The available configuration tags are as follows:

  • autodnsdomain (Required) - The full domain name to point to. (ex.
  • autodnshostedzoneid (Required) - The Hosted Zone ID (ex. Z119WBBTVP5WFX)

awsautodns uses aws-cli to interact with AWS. It is best practice to create an AMI User for the tool to use with only the required permissions (make sure to save the access key). The required permissions are as follows:

	"Effect": "Allow",
	"Action": [
	"Resource": "*"
	"Effect": "Allow",
	"Action": "route53:ChangeResourceRecordSets",
	"Resource": "arn:aws:route53:::hostedzone/YOURHOSTEDZONEIDHERE"


Install all dependencies.

  • Ubuntu (net-tools, aws-cli, gcc, make, git):

    sudo apt -y update && sudo apt -y install net-tools && sudo apt -y install gcc && sudo apt -y install make && sudo apt -y install git

    If aws-cli is not already installed, install it.

    • If installing on an ARM64 system, replace "x86_64" with "aarch64".
     sudo apt -y install unzip
     curl "" -o ""
     sudo ./aws/install
     rm -rf aws/
  • Amazon Linux 2/RHEL (net-tools, aws-cli, gcc, make, git):

    sudo yum -y update && sudo yum -y install net-tools && sudo yum -y install gcc && sudo yum -y install make && sudo yum -y install git

    If aws-cli is not already installed, install it.

    • If installing on an ARM64 system, replace "x86_64" with "aarch64".
     sudo yum -y install unzip
     curl "" -o ""
     sudo ./aws/install -b /usr/sbin
     rm -rf aws/

If you haven't already done so, configure aws-cli as root.

  • The Default output format must be set to json
sudo su
aws configure && exit

Clone this repo.

sudo git clone

Run the install bash file. Note: In RHEL, the install script must set SELINUX=disabled, due to a bug with SELinux. This has security implications.

sudo bash awsautodns/


Uninstalling awsautodns is simple.

sudo systemctl stop awsautodns && sudo systemctl disable awsautodns
sudo rm -f /etc/systemd/system/awsautodns.service
sudo rm -rf /opt/awsautodns

If you wish to also remove the log file,

sudo rm -f /var/log/awsautodns.log.


Automatic AWS Route53 domain registration for EC2 instances



No releases published


No packages published