As you can't set CNAMES using local hosts file, I needed to setup a simple hosted DNS server we can point at so our team can see a beta version of our system which happens to be on AEM CMS which uses fastly and requires CNAMES to access.
I tried setting up an Azure "DNS Zone"
then I added a "record set" of "mytargetdomain.com" with a CNAME of cdn.adobeaemcloud.com, and one for "www.mytargetdomain.com" to it.
at the top of the resource overview, it shows
Name server 1 : ns1-08.azure-dns.com.
etc.
If I use ns1-08.azure-dns.com as my dns server, and query mytargetdomain.com it gives me the live A record IP, not the CNAME I just setup.
nslookup mytargetdomain.com ns1-08.azure-dns.com
gives:
Server: ns1-08.azure-dns.com
Address: 40.90.4.8#53
*** Can't find mytargetdomain.com: No answer
I must admit I don't know much about DNS and SOA etc, but there really isn't anything else which can be configured or edited.
Best Answer
The name of a record in a DNS zone should not include the domain name. To create a record called
www.domain.com
in a zone calleddomain.com
, the record name should bewww
.You can create a CNAME record called
www
in yourmytargetdomain.com
zone and set its value tocdn.adobeaemcloud.com
; this will effectively mapwww.mytargetdomain.com
tocdn.adobeaemcloud.com
.You can also create a record with an empty name; this will map the domain name itself to a target. However, this can only be done using A records, not CNAME ones; you can map a domain name to an IP address, but not to another name.