Dynamic DNS (IP) for Route 53 Domain

0

Hi,

I have a domain on Route 53 and I'd like to use my own private server (NAS) to host my site. My server is publicly accessible but it is behind a dynamic IP. I also have a Dynamic DNS with dynu. My question is how can I setup my domain to get my servers latest/current IP address?

Many thanks for your help

Lockie
질문됨 2년 전1867회 조회
2개 답변
2
수락된 답변

Hello -

One way to do this if you are using dynamic DNS tools like dynu or DuckDNS is that you create a CNAME record for one of your subdomains such as www.yourdomain.com with the value of the dynamic DNS service domain name.

You can also refer to the following post highlighting how you could implement automation to update records directly in R53. Note you can also modify the code and make API calls to R53 in your local machine vs Lambda.

Jason_S
답변함 2년 전
profile picture
전문가
검토됨 9달 전
AWS
전문가
Scott
검토됨 2년 전
  • Thank you for your reply. I've seen examples of this execution but it seemed that I had to add a prefix to my domain. For example it would mean entering www.prefix.yourdomain.com Rather than simply www.yourdomain.com

    In addition I'd like to ensure the domain you see in the browser stays as the originally entered domain and it is not forward to another domain name.

  • In that case you will need to deploy machinists to dynamically update records in R53, similar to how dynu works under the hood. I will update my original answer with a post.

  • Many Thanks for that.

0

You can simply have your instance update the record in Route 53 to point to the new IP address.

For example:

# Update Route 53 Record Set based on the Name tag to the current Public IP address of the Instance
MY_IP=$(curl -s http://169.254.169.254/latest/meta-data/public-ipv4/)

aws route53 change-resource-record-sets --hosted-zone-id $ZONE --change-batch '{"Changes":[{"Action":"UPSERT","ResourceRecordSet":{"Name":"'$NAME_TAG'","Type":"A","TTL":300,"ResourceRecords":[{"Value":"'$MY_IP'"}]}}]}'

For a full example of this process, see: Amazon Route 53: How to automatically update IP addresses without using Elastic IPs - DEV Community

답변함 2년 전

로그인하지 않았습니다. 로그인해야 답변을 게시할 수 있습니다.

좋은 답변은 질문에 명확하게 답하고 건설적인 피드백을 제공하며 질문자의 전문적인 성장을 장려합니다.

질문 답변하기에 대한 가이드라인