1

Is it possible to point a domain to a dns address?

Why do I want to do this?

I want to point X number of domains to a server, if that server needs to be switched out (or whatever reason), I just want to update one DNS instead of all domain / sites on that server. So what i need is a proxy for the domains pointing to that one server. If I decide to switch server/ip. Im currently on a LAMP setup.

Maybe this is "bad practice" so I’m open to alternatives. But for the sake of this question, if this is possible answers is appreciated.

sdfgg45
  • 195
  • 1
  • 1
  • 6
  • If your DNS provider supports an "alias" record - AWS does - this is very possible. You can sort of do it otherwise with a `CNAME`, but that has [some downsides](https://serverfault.com/questions/613829/why-cant-a-cname-record-be-used-at-the-apex-aka-root-of-a-domain) where other record types (`MX`, `SPF`, etc.) are concerned. – ceejayoz Feb 02 '18 at 22:01

1 Answers1

1

Very common and exactly what I do on my personal blog, just set a low ttl (30) and make sure your nameservers can handle the query load.

Also, this is why I never use the naked domain (example.com vs www.example.com) whereas I have multiple A records for example.com that only does a 301 to www.example.com which is a CNAME to the active server.

Jacob Evans
  • 7,886
  • 3
  • 29
  • 57
  • just a sidenote, some caching name servers (in home router/ office / small ISP) don't strictly follow the TTL. so the actual time to switch could be as much as 2 hours. – Shiji.J Feb 03 '18 at 06:05
  • Yes, which is why bgp is a better way of moving services, you can also depend on "happy eyeballs" and preload the new IP address to round robin your service, then block or stop the service on the old address while TTL expires. – Jacob Evans Feb 03 '18 at 06:08
  • IS there some guides or articles around how to on this one? – sdfgg45 Feb 03 '18 at 08:41
  • It's a complexity you don't need. If nameservers don't respect your TTL that's not your problem IMHO. A simpler option would be to use cloudflare and swap backends, which is near instant. – Jacob Evans Feb 03 '18 at 12:26