Stop 18 · Cloud & HostingTopics · 7/11

Domain & DNS Setup

Part of the Backend Developer Roadmap

In short

Nobody remembers 13.235.12.7. DNS turns api.yourapp.in into that address, and getting a few records right is the difference between 'it's live' and 'it only works on my IP'.

Pointing a custom domain name at your deployed backend — configuring DNS records so a subdomain like api.yourdomain.com resolves to your hosting provider.

The purple blob flips through a paper contact book while holding a phone receiver.

Think of it like this

Your phone's contact list

You don't dial ten digits for your friend, you tap 'Rohan'. The phone looks up the number and calls it. If Rohan changes his number, you update the contact once and every call still works. DNS is the internet's contact list: names in, IP addresses out.

Watch it happen

Resolving api.shop.in

. (root)
.in
.com
shop.in
api.shop.in
www.shop.in

1/5Your resolver asks a root server about api.shop.in. Root only knows who runs .in.

The big ideas

What you need to know

A and AAAA

Point a name to an IPv4 (A) or IPv6 (AAAA) address. Use these for servers with fixed IPs.

CNAME

Point one name to another, like www to yourapp.onrender.com. Standard DNS doesn't allow it on the bare root domain.

TTL

How long resolvers cache an answer. Lower it to 300 seconds a day before you move servers.

MX and TXT

MX routes email. TXT holds domain verification and email security records like SPF and DKIM.

See it in code

Walk through the code

bash
1# What does api.shop.in point to?2dig api.shop.in A +short3# 13.235.12.74 5# Follow the whole chain from the root servers6dig api.shop.in +trace7 8# Check a CNAME and how much TTL is left9dig www.shop.in CNAME +noall +answer10# www.shop.in.  287  IN  CNAME  shop.in.11 12# Ask a specific public resolver (handy right after a change)13dig @1.1.1.1 api.shop.in +short

1/4+short prints just the answer, here the server's IPv4 address.

dig is the stethoscope for DNS. Comparing answers from different resolvers tells you whether a change has spread yet.

Save yourself the pain

Common mistakes

Oops

Changing a record with a 24-hour TTL and panicking when nothing updates.

Do this instead

Old answers stay cached until the TTL runs out. Lower the TTL a day before planned changes.

Oops

Adding a CNAME on the bare domain shop.in.

Do this instead

Standard DNS forbids CNAME at the root. Use an A record, or your provider's ALIAS or CNAME flattening feature.

Your mission

Wire up a domain

~30 min

Quick check

You moved your API to a new server and updated the A record. An hour later some users still hit the old server. Why?

Go deeper

  1. 1Point a subdomain you own at a deployed API using a CNAME or A record.
  2. 2Learn the difference between an A record (IP address) and CNAME (another domain name).
  3. 3Understand DNS propagation delay — changes aren't always instant.

More topics at this stop

Stuck on this topic? Ask an Insider

Get 1:1 guidance from people who've walked this exact path — on the InsideEdge app.

Download
InsideEdge