如何将GoDaddy域名绑定到AWS WHM?配置后无法访问排查
Let’s break down the most likely missing steps here—setting up custom nameservers and WHM can have a few easy-to-miss gotchas, so let’s go through them one by one:
Wait for DNS Propagation (and Verify It)
Custom nameserver changes can take anywhere from a few minutes to 48 hours to propagate globally. First, confirm your domain is actually using your new NS records:- Run
dig NS yourdomain.comin your terminal. The output should listns1.domain.comandns2.domain.comas the authoritative nameservers. - If you don’t see them, double-check your GoDaddy settings: make sure you saved the NS record changes correctly (sometimes the UI requires an extra confirmation step to finalize).
- Run
Open DNS Port 53 on AWS Security Groups
DNS relies on both UDP and TCP port 53 to communicate. If your AWS instance’s security group isn’t allowing inbound traffic on these ports, external DNS servers can’t query your WHM’s DNS service.- Head to your AWS EC2 dashboard, open the security group attached to your instance, and add inbound rules for:
- Type: DNS (UDP), Port: 53, Source: 0.0.0.0/0
- Type: DNS (TCP), Port: 53, Source: 0.0.0.0/0
- Head to your AWS EC2 dashboard, open the security group attached to your instance, and add inbound rules for:
Fix Missing NS Records in WHM’s DNS Zone
Even if you added A records, you might be skipping critical NS records in your domain’s DNS zone:- Log into WHM and go to
DNS Functions > Edit DNS Zonefor your domain. - Ensure you have both:
- NS records pointing to your custom nameservers (note the trailing dot—it’s crucial for absolute domain resolution):
@ NS ns1.domain.com. @ NS ns2.domain.com. - A records for
ns1andns2pointing to your AWS IP (you mentioned this, but double-check there’s no trailing dot on the IP:ns1 A 52.70.xxx.xxxis correct).
- NS records pointing to your custom nameservers (note the trailing dot—it’s crucial for absolute domain resolution):
- Also confirm your main domain’s A record is set to
52.70.xxx.xxx, and that subdomains likecpanel.yourdomain.comhave an A record pointing to the same IP (WHM usually creates these automatically, but it’s worth verifying).
- Log into WHM and go to
Ensure WHM’s DNS Service is Running
If BIND (the DNS service WHM uses) isn’t active, your nameservers won’t respond to queries:- In WHM, go to
Service Configuration > Service Manager. - Find
named(BIND DNS Server) and make sure it’s set to "Enabled" and "Monitor". If it’s off, start it and save the settings.
- In WHM, go to
Open Ports for cPanel and Web Access
Even if DNS works, blocked ports will prevent you from accessing the website or cPanel:- AWS Security Group: Add inbound rules for ports 80 (HTTP), 443 (HTTPS), 2082 (cPanel HTTP), and 2083 (cPanel HTTPS).
- Server Firewall: If you’re using
firewalldoriptableson your AWS instance, ensure these ports are open too. For firewalld, run:sudo firewall-cmd --add-port=80/tcp --permanent sudo firewall-cmd --add-port=443/tcp --permanent sudo firewall-cmd --add-port=2082/tcp --permanent sudo firewall-cmd --add-port=2083/tcp --permanent sudo firewall-cmd --reload
Check for GoDaddy Domain Lock
Sometimes GoDaddy locks domains by default, which can interfere with nameserver changes. Go to your GoDaddy domain management page, check the domain status, and ensure it’s set to "Unlocked".Flush Local DNS Cache
Your local computer might still be caching old DNS records. Flush it to force a fresh lookup:- Windows:
ipconfig /flushdns - Mac:
sudo dscacheutil -flushcache - Linux:
sudo systemd-resolve --flush-caches
- Windows:
内容的提问来源于stack exchange,提问作者user1hjgjhgjhggjhg

