问题描述
我在AWS上注册了一个域,并为其设置了托管区域。
我想在www.something.com
托管的第三方网站上解析我的域https://www.example.com
我了解命名的原理,但是某些方法无法正常工作,我也不明白为什么。
因此,我已经正确地将CNAME声明为值https://www.example.com
。
现在,当执行dig www.something.com
时,我得到以下响应:
; <<>> DiG 9.10.6 <<>> www.something.com
;; global options: +cmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY,status: NOERROR,id: 39539
;; flags: qr rd ra; QUERY: 1,ANSWER: 2,AUTHORITY: 0,ADDITIONAL: 1
;; OPT PSEUDOSECTION:
; ednS: version: 0,flags:; udp: 4096
;; QUESTION SECTION:
;www.something.com. IN A
;; ANSWER SECTION:
www.something.com. 300 IN CNAME https://www.example.com.
https://www.example.com. 751 IN A 46.30.215.88
;; Query time: 57 msec
;; SERVER: 192.168.178.1#53(192.168.178.1)
;; WHEN: Tue Aug 11 21:34:22 CEST 2020
;; MSG SIZE rcvd: 113
在我看来CNAME解析正确。 但是我的客户给我以下信息:
对于www.something.com,我收到:
<html><head>
<title>404 Not Found</title>
</head><body>
<h1>Not Found</h1>
<p>The requested URL was not found on this server.</p>
</body></html>
尝试https://www.something.com我得到:
* Connected to www.something.com (46.30.215.88) port 443 (#0)
* ALPN,offering h2
* ALPN,offering http/1.1
* successfully set certificate verify locations:
* CAfile: /etc/ssl/cert.pem
CApath: none
* TLSv1.2 (OUT),TLS handshake,Client hello (1):
* TLSv1.2 (IN),TLS alert,handshake failure (552):
* error:14004410:SSL routines:CONNECT_CR_SRVR_HELLO:sslv3 alert handshake failure
* Closing connection 0
curl: (35) error:14004410:SSL routines:CONNECT_CR_SRVR_HELLO:sslv3 alert handshake failure
我已经等了24小时以上,但问题仍然存在。 我已经为https://www.example.com连接了主机提供商,他们声称我设置的CNAME是正确的。
我现在没主意了,因为这是一个非常简单的任务。只是我无法正确解析ALIAS。
解决方法
当它返回404时,它确认它实际上是在解析主机。
仅需确认该值应为域名本身(不包括协议或路径,应为example.com
而不是https://example.com
)。
您可以通过覆盖本地主机文件以将目标域解析为特定的IP地址(例如DIG
命令中的地址)来在本地进行测试
如果您认为CNAME
是正确的,那么您应该尝试与向您提供此信息的任何人联系,以确认他们最终收到了请求。