Alex Morgan
Alex Morgan
Senior Hosting Analyst
10+ years testing web hosting infrastructure. Benchmarks servers across 4 continents.

如何将域名 DNS 指向主机 2026

Buying a domain and buying hosting are two separate steps until DNS ties them together. This guide explains nameserver delegation versus A/CNAME records, how to edit DNS at your registrar, and how to confirm propagation without guesswork.

我们如何核对文中步骤

发布前,若步骤依赖主机商,我们会在至少两家平台各走一遍;否则在同一环境隔日执行两次。我们记录控制台报错、不同地区的界面文案差异,并在厂商调整按钮位置后立即更新文案。路径与截图每季度抽检。涉及 DNS、SSL 或付款时,我们确认回滚/补救选项,并链接到官方文档以获取权威表述。

  1. 1

    Step 1: Decide nameservers vs A record

    If your host gives you two or more nameservers (e.g. ns1.example.com), pointing the domain at the host is usually easiest. The host then manages all DNS. If you keep DNS at Cloudflare or your registrar, instead add an A record for @ to your server IP and a CNAME for www to your apex or host-provided target.

  2. 2

    Step 2: Find your host's nameservers or IP

    In your hosting welcome email or control panel, copy the exact nameserver hostnames or the IPv4 address for your account. Typos here are the #1 cause of "site not found" issues.

  3. 3

    Step 3: Update DNS at the registrar

    Log into Namecheap, GoDaddy, or IONOS → Domain → DNS / Nameservers → Custom DNS. Paste each nameserver. Save. If using A/CNAME only, switch to DNS records mode and add @ A and www CNAME per your host's doc.

  4. 4

    Step 4: Lower TTL before big changes (optional)

    If migrating live traffic, drop TTL to 300 seconds a day ahead so rollback is faster. then raise TTL again after stability.

  5. 5

    Step 5: Wait for propagation

    Global propagation typically takes minutes to 48 hours. Use a public DNS checker tool querying multiple regions to see when new values appear.

  6. 6

    Step 6: Verify SSL and WordPress URL

    Once DNS resolves, issue SSL in the hosting panel, then in WordPress set Settings → General URLs to https if needed.

1
Namecheap Best Value
Portfolios and Stellar/EasyWP have lived here for years: renewals stay readable, WHOIS privacy is included, and the combo still undercuts most 'domain + host' bundles we price out.
★★★★½
✓ 优点
  • Transfer codes, nameserver changes, and DNS timing all tested on Namecheap.
  • Clear renewal pricing, easy to track across a large domain portfolio.
  • Free WHOIS privacy on registrations and transfers.
✕ 缺点
  • Check Namecheap bundles so DNS does not break if hosting lapses.
  • Not the fastest host. Plan caching and a CDN for speed-critical sites.
月价格$1.98
存储空间20 GB SSD
免费域名✓ 是
在线时间99.9%
2
Hostinger Top Pick
Hostinger has survived multiple yearly cycles on our bench: LiteSpeed, hPanel, and sub-$3 intro pricing still deliver the best overall value for most sites we migrate.
★★★★½
✓ 优点
  • Transfer codes, nameserver changes, and DNS timing all tested on Hostinger.
  • Fast LiteSpeed loading, consistent in our repeated tests.
  • Good storage, SSL, and backups on entry plans, no forced add-ons at login.
✕ 缺点
  • Check Hostinger bundles so DNS does not break if hosting lapses.
  • No phone support on any plan.
月价格$2.99
存储空间100 GB SSD
免费域名✓ 是
在线时间99.9%

常见问题

Can I use Cloudflare with shared hosting?+
Yes. point nameservers to Cloudflare, then set A/CNAME to your host origin; enable "Full (strict)" SSL when origin has a valid cert.
What if email breaks after DNS change?+
If you replaced all records, restore MX records from your email provider. Nameserver-only changes should not remove MX if email is at Google/Microsoft. but always verify.