I need to set a wildcard DNS record for a sub domain which already has an A record. I'm not sure if i have to use a new A record for this or can just use a CNAME that points to the A record.
My script has the following domain structure
http(s)://{random_code}.{location_subdomain}.{domain.com}/{path}
- {random_code} - We use random code as a solution against browser implemented HTTP socket limits. (only used for loading dynamic elements onto a page - as such it can only be viewed by viewing the source of a web page while the URL in a users browser only shows the location subdomain)
- {location_subdomain} - We load content from our closest server to the user, so each location has an A record that points to a different server (content across all our location servers are 1:1).
- {domain.com} - Points to our front end server which hosts our index page
- {path} - self exploratory
Current DNS zone file
domain.org. 86400 IN NS dns1.domain.org.
domain.org. 86400 IN NS dns2.domain.org.
domain.org. 86400 IN NS dns3.domain.org.
domain.org. 86400 IN NS dns4.domain.org.
domain.org. 14400 IN A 1.1.1.1
localhost 14400 IN A 127.0.0.1
www 14400 IN CNAME domain.org.
ftp 14400 IN A 1.1.1.1
france 3600 IN A 2.2.2.2
phoenix 3600 IN A 3.3.3.3
nl 3600 IN A 4.4.4.4
* 14400 IN A 1.1.1.1
But i need to add a wildcard for each location A record that points to the same address. So for example {randome_code}.phoenix.{domain.com} would point to 3.3.3.3 while still making sure phoenix.{domain.com} still points to the same IP.
Do i just have to create new A records like this for each location while keeping the non wildcard records as well?
*.france 3600 IN A 2.2.2.2
*.phoenix 3600 IN A 3.3.3.3
*.nl 3600 IN A 4.4.4.4
I was under the assumtion that this would be an extra lookup so i thought i would be able to use a CNAME but im not sure the proper format to add a wildcard CNAME record that points to an already created A record while still keeping the original wildcard working so that any lookup that are not using a location subdomain would still be answered with our front end web server address.
Or do i have this completely wrong, can i not have a wildcard on the root domain as well as on A records ?