AWS Route53里使用Godady注册的域名

AWS的Route53是可以注册域名的,但是如果在外部注册的域名怎么在Route53里使用呢,这里使用外网的DNS服务的Godaddy注册域名,并在AWS的Route53里使用。

注册域名并下载Zonefile

在Godaddy里注册域名xionghuilin.club,并在管理域名里下载Zonefile, 自动下载并命名为xionghuilin.club.txt

在Route53里创建hosted zone

在Route53里创建hosted zone,会自动生成SOA和NS,如下:

Create hosted zone

在Godaddy中添加新生成的NS

以下四条NS需要添加到Godaddy中,xionghuilin.club的name server如下:

ns-727.awsdns-26.net. 
ns-1182.awsdns-19.org. 
ns-1565.awsdns-03.co.uk. 
ns-211.awsdns-26.com.

这里在Godaddy里添加name server的时候要去掉最后的点,不然输入会不成功。

结果如下:

GoDaddy

创建两个EC2实例

使用以下启动脚本在新加坡创建一个EC2的实例,public IP是18.141.25.16

#!/bin/bash
yum update -y
yum install httpd -y
service httpd start
chkconfig httpd on
cd /var/www/html
echo "<html><h1>Hello Xiong! This is the Singapore Web Server</h1></html>" > index.html

使用以下启动脚本在South America (São Paulo)创建另一个EC2的实例,public IP是52.67.73.251

#!/bin/bash
yum update -y
yum install httpd -y
service httpd start
chkconfig httpd on
cd /var/www/html
echo "<html><h1>Hello Xiong! This is the South America (São Paulo) Web Server</h1></html>" > index.html

检查两个EC2的httpd服务器都正常工作,如下:
EC2working

在Route53里导入Zone file

有一个Import Zone File按钮,导入后再添加一个Record setRouting Policy以下可以选择,
Simple
Weighted
Latency
Failover
Geolocation
Multivalue Answer
在这里选择Geolocation比较好看效果,把两个公网IP地址输入到
18.141.25.16
52.67.73.251
注:以下设置地理位置的时候貌似要设置到国家。

Create a record

测试

以下测试结果是根据地理位置,从新加坡访问xionghuilin.club就一直会访问新加坡的服务器。

Test result

术语

以下是一些术语的解释:

SOA, Start of Authority record

NS, Name Server Records

A Record --> Address Record

CName is Canonical Name Canonica: 意思是权威,公认的, CName can be used to resolve one domain name to another.

Alias Record:

Alias records are used to map resource record sets in your hosted zone to Elastic Load Balancers, CloudFront Distributions, or S3 buckets that are configured as websites.

Key difference: A CName cannot be used for naked domain names (Zone Apex record., you can’t have a CName for http://acloud.guru
, it must be either A record or an Alias

最后,这里并没有使用ELB, Elastic Load Balancer, 还可以在Route53里创建Health checks,也并没有测试。

Reference

Migrating a Domain to Amazon Route53

  • 1
    点赞
  • 4
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值