How to Connect a Custom Domain to Your Site With an AI Agent
To connect a custom domain with an AI agent you need two things: the record your host wants — a CNAME or A value from its custom-domain screen, or from the hosting MCP itself on Vercel — and a DNS server the agent can write to: Cloudflare, Porkbun, Hostinger, Name.com, Vercel or the Namecheap API server. Then verify from outside with IntoDNS and let the host issue the certificate. Five steps, each with the prompt to paste.
Goal
A domain you own answers on a site you deployed
Time
~10 min, plus propagation
Prereq
A deployed site, a domain, and the registrar or DNS MCP connected
Steps
Get the record your host wants
Every host publishes the same two shapes: a CNAME for a subdomain such as www, pointing at the host's hostname, and an A (or ALIAS) record for the bare apex. On Vercel the agent can do this half itself — add_project_domain attaches the name to the project, and list_project_domains reports whether it is verified and what it expects. On other hosts the value sits on the custom-domain screen of the dashboard; paste it into the conversation. Do not let the agent guess an IP.
I am adding www.example.com to my site on Vercel. Add the domain to the project "example-site" and tell me exactly which DNS record the project expects for it.
Read the zone before you write anything
Three of the six writing servers replace the whole record set if you let them: Namecheap's set_dns_hosts always, Hostinger's dns_records_update with overwrite, Vercel's BIND replace. Even on the per-record servers, reading first is how the agent notices an existing record it would collide with. Porkbun: dns_list. Hostinger: dns_records_list through execute. Namecheap: get_dns_hosts. Name.com: ManageDNS with operation list. Cloudflare: the zone's DNS records endpoint through execute.
List every DNS record on example.com and show me the table before you change anything. Tell me if a record already exists for www or for the apex.
Write the record with the safest tool the server has
Prefer the tool that cannot delete what you did not send. Porkbun: dns_upsert for one record, or domain_cutover_web to move the whole web presence to a new target in one call. Hostinger: dns_records_validate, then dns_records_update without overwrite. Name.com: ManageDNS create. Vercel (when Vercel manages the DNS): update_record, or create the record the project asked for. Namecheap: get_dns_hosts, merge, then set_dns_hosts with the complete set. Cloudflare: execute against the DNS records endpoint, with the record set to DNS only (not proxied) unless the host tells you otherwise.
Add a CNAME for www.example.com pointing at cname.vercel-dns.com with a 300-second TTL. Use the upsert tool if this server has one. Do not modify or delete any other record. Show me the exact call before you run it.
Wait, then verify from outside — not by re-reading the record
A record the agent reads back from the same server one second after writing it will always look right; that is the authoritative answer, not what the internet sees. Wait a few minutes, then ask IntoDNS: check_dns_propagation asks nine resolvers and reports the ones that still disagree, and lookup_dns reads the record over DNS-over-HTTPS. On the command line, dig does the same for one resolver.
Wait for me to say "check". Then use IntoDNS check_dns_propagation for www.example.com, record type CNAME, and report which resolvers agree. Do not edit the record again unless I ask.
Let the host issue the certificate
Hosts provision TLS automatically once the record resolves; a pending certificate a few minutes after a DNS change is normal. On Vercel the agent can check with list_certs and request one with issue_cert; Porkbun's ssl_retrieve fetches the bundle Porkbun issues for its own domains. The one thing to forbid: an agent that "fixes" a pending certificate by rewriting the record it just set.
Check whether the certificate for www.example.com has been issued. If it is still pending, tell me how long to wait. Do not change any DNS record.
Full-replace tools delete what you did not send
Which write tool, per server
| Zone lives at | Read | Write one record | Undo |
|---|---|---|---|
| Cloudflare | DNS records endpoint via execute | Create or update via execute, DNS only | Delete the record; Change History for audit |
| Porkbun | dns_list | dns_upsert, or domain_cutover_web for the whole web presence | dns_remove; writes need --get-muddy |
| Hostinger | dns_records_list | dns_records_validate, then dns_records_update (no overwrite) | dns_snapshots_restore |
| Name.com | ManageDNS list | ManageDNS create | ManageDNS delete by id |
| Vercel-managed DNS | get_domains_records_by_record_id | update_record | update_record again; avoid the BIND replace |
| Namecheap | get_dns_hosts | set_dns_hosts with the merged full set | set_dns_hosts with the previous full set — keep it |
One connection can do both halves
Frequently asked questions
Do I need to change the nameservers to connect a domain?
Usually not. Pointing a domain at a site is a record inside the existing zone — a CNAME for www, an A or ALIAS record for the apex — and the servers on this page write those. You change nameservers only when you are moving DNS hosting itself, for example to Cloudflare or to Vercel, and that is a separate, slower change: Porkbun's domains_update_nameservers, Namecheap's set_custom_nameservers, Name.com's ManageDomains setNameservers and Hostinger's domains_portfolio_update-nameservers all do it.
What is the difference between www and the bare domain?
A subdomain like www can be a CNAME to the host's hostname, which follows the host if its addresses change. The bare apex cannot carry a CNAME under DNS rules, so hosts give you an A record with an IP, or the DNS provider offers an ALIAS or flattened CNAME. Ask the host for both values and set both, then redirect one to the other on the host side.
How long does it take before the site answers on the domain?
Minutes to hours. New records usually resolve within minutes; a changed record can lag for as long as the old TTL, and some resolvers cache longer than they should. IntoDNS's propagation check shows you which resolvers have caught up. Certificate issuance starts once the host can resolve the name, so it adds a few more minutes.
Can one MCP do both the hosting side and the DNS side?
Two can. Vercel's MCP attaches the domain to the project, writes the records if Vercel manages the DNS, and issues the certificate. Hostinger's MCP deploys the site and writes the zone through the same execute tool. Everywhere else it is two servers: the host's for the target, the registrar's or DNS provider's for the record.
Can I do this from ChatGPT?
For Vercel and Cloudflare, yes: both are hosted servers ChatGPT reaches as connectors (Vercel is reviewed; Cloudflare through Developer mode), and the GoDaddy and Namecheap apps edit DNS on their own accounts inside ChatGPT. Porkbun, Name.com, Hostinger and the Namecheap API server run locally and need Claude Desktop, Claude Code, Cursor or another local client.
The host says "invalid configuration" — what does the agent do?
Nothing, for a few minutes. The three usual causes are propagation lag, a proxied record where the host wanted DNS only, and a record on the wrong name (apex versus www). Have the agent run the IntoDNS propagation check and read the record type and value back from outside before it touches anything. An agent that rewrites the record every time the host reports pending is the failure this page exists to prevent.
Before and after this step
Publish the site first, pick the DNS server by its write model, or read which servers can register the name in the first place.
Related guides
Ranked Guide
Best MCPs for DNS Management in 2026 (Records, Propagation, DNSSEC)
9 min read
Tutorial
How to Publish an AI-Built Website With an MCP (No Git, No Terminal)
7 min read
Tutorial
How to Buy a Domain From Claude (Cloudflare MCP, Step by Step)
6 min read
Tutorial
Deploy to Vercel With an AI Agent (Vercel MCP, 2026)
7 min read
Tutorial
Deploy to Cloudflare With an AI Agent (Cloudflare MCP, 2026)
7 min read
Setup Guide
Best MCP Servers for Domains in 2026 (Registrars + DNS)
10 min read