我已经使用运行Web服务器的CentOS继承了Azure VM。我可以通过使用端口8080的IP地址来访问它(我们将其命名为12.34.567.890:8080)。
我已经在GoDaddy注册了example.app域。现在我需要将它们连接起来。我知道我需要设置DNS记录,但是我不确定是否要通过将GoDaddy上的名称服务器更改为Azure的名称服务器,然后在Azure上设置DNS区域,或者是否将名称服务器保持在GoDaddy并在那里设置DNS区域以指向Azure(后者是当前设置方式)。我已经尝试了几件事,但到目前为止还没有喜悦。
当前似乎两者都有(其他人在我之前从事过此工作,我不确定这两种情况下的默认值)。
所以,在GoDaddy,我们有:
Using Default name servers:
ns77.domaincontrol.com
ns78.domaincontrol.com
A records:
@ 12.34.567.890 (the IP of the Azure server)
* 12.34.567.890
CNAME:
www @
NS:
@ ns77.domaincontrol.com
@ ns78.domaincontrol.com
SOA:
@ Primary nameserver: ns77.domaincontrol.com
我可以编辑A和CNAME记录,但不能编辑NS或SOA记录。
在Azure(在DNS区域中),我有:
Resource group: www.example.app
Name Server 1: ns1-04.azure-dns.com
Name Server 2: ns2-04.azure-dns.net
Name Server 3: ns3-04.azure-dns.org
Name Server 4: ns4-04.azure-dns.info
Name Type TTL Value Alias resource type Alias target
@ A 3600 - Public IP Address example-prod-ip
@ NS 172800 ns1-04.azure-dns.com.
ns2-04.azure-dns.net.
ns3-04.azure-dns.org.
ns4-04.azure-dns.info.
@ SOA 3600 Email: azuredns-hostmaster.microsoft.com
Host: ns1-04.azure-dns.com.
Refresh: 3600
Retry: 300
Expire: 2419200
Minimum TTL: 300
Serial number: 1
同样,我必须选择编辑或删除A记录,而不必选择其他记录。
如果我尝试通过浏览器转到该域,则会得到以下信息:
Using 12.34.567.890:8080 - works fine
Using 12.34.567.890 - "Safari can't open the page because the server isn't responding"
Using example.app or www.example.app or http://www.example.app - "Safari can't open the page because Safari can't establish a secure connection to the server"
我不知道域名仅仅是“ example.app”是否也有所作为。我接下来可以尝试什么?
答案 0 :(得分:1)
首先,默认情况下,Web浏览器默认使用HTTP端口80或HTTPS端口443访问Web服务器。如果使用非默认端口8080,则在访问网站时需要添加该端口,例如{ {1}},http://12.34.567.890:8080
或http://www.example.app:8080
。
您可以选择以使用Azure DNS托管您的域,但这不是必须要做的。您的域仍在GoDaddy上注册。 host your domain in Azure DNS之后,您需要将Azure名称服务器添加到您的域注册中,而不是在GoDaddy中使用默认名称服务器。我的印象是,将域托管在Azure DNS中之后,您将无法在GoDaddy中编辑记录。
然后,要将您的自定义域映射到您的网站,您需要在域DNS区域中添加http://example.app:8080
或A
记录。对于CNAME
记录,您需要添加A
类型的@
和*
并指向VM的公共IP地址。对于A
记录,您需要添加CNAME类型的CNAME
并指向VM的FQDN名称。参见creating a FQDN。
最后,在这种情况下,我看到您在域提供程序中具有正确的A记录配置。这应该工作。您无需再创建一个Azure DNS区域。因此,您使用的是www
很好。在其他Web浏览器中访问网站时,只需添加8080端口。如果不想每次都添加端口,则可以更改Web服务器的侦听端口,并通过附加到Azure VM子网的network security group来限制网站在受限源IP中的访问权限。
12.34.567.890:8080