0

I have a number of domains that I'm hosting on my web server, so I've edited their A record to point to my server's IP address. Occasionally I have to change the server's IP address, which means I have to edit the A record for each domain hosted on that server. There's also risk that a website would go down because the change was not made for its A record.

I'd like to simplify this if possible. Is there a way I could set the A record to a domain or subdomain, then set that domain/subdomain to the desired IP, so that when the IP changes, I would need to change only 1 location instead of multiple domains? I'm open to ideas. It does not have to be exactly this way through the A record. Anything that gets me the desired effect is fine.

2 Answers 2

2

It sounds like you have configured A records to point to the 'www' subdomain of your domains. Instead, you should configure your root domain (the example.com instead of www.example.com) to have an A record with the actual IP of the server. You should then configure CNAMEs that point to example.com for each subdomain.

Here is what you would want your records to look like:

Name                    Type        Value
example.com.            A           192.168.1.1
www.example.com.        CNAME       example.com.
subdomain.example.com.  CNAME       example.com.
example2.com.           CNAME       example.com.
sub.example2.com.       CNAME       example.com.

Edit

Thanks to ajdle for pointing out the missing dot at the end, making the record fully qualified. Otherwise, DNS would think it was relative to your root domain and attempt to add it's search path to the record, which could result in an attempt to resolve 'example.com.example.com' - see this discussion about the difference between 'example.com' and 'example.com.'.

4

The DNS RR you need to learn about is called CNAME.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .