https://example.com is not getting resolved - dns

I'm supporting a client which is having an issue with their naked domain not getting resolved when requested through https.(https://example.com)
All of these other url are resolved:
http://example.com
http://www.example.com
https://www.example.com
DNS Setup
In their dns settings. The example.com is forwarded to http://www.example.com
A record is not pointing to the actual IP of the web server instead is pointing to the IP of the DNS provider. (I think this is the default when they bought the domain).
CNAME www is then pointing to their Azure DNS hostname (*.cloudapp.net) which contains their company DNS records. (forwarding the request to another name server by CNAME)
What I've tried:
pointed the A record to the correct web server IP and now the https://example.com is getting resolved.
Questions:
Why is the https://example.com was not getting resolved?
Is the CNAME forwarding to another name server a correct setup instead of just changing the name servers to Azure?

Why is the https://example.com was not getting resolved? - This is because the A record has to point to an IP address of the web server pointing it to the IP address of the DNS server is wrong, until you have the same ip address serving http requests and dns requests both.
My guess is that *.cloudapp.net is the domain where the actual application is hosted instead of DNS hostname. A CNAME can point to another hostname is perfectly fine, provided the another hostname resolves to the correct destination server ip address.

Related

What is the correct DNS record setup for www subdomain?

I would like to set up my web app to use the "www" subdomain as my primary url. I'll be using a service to handle 301 redirects from my naked/apex domain to my subdomain (example.com -> www.example.com). What is the correct DNS record type for my "www" subdomain? Cant seem to find a clear answer on this.
An "A" record pointing to my websites IP address?
A "CNAME" pointing to my naked/apex domain?
It's CNAME. A record is pointing to the webserver IP address. CNAME will serve as an alias. Commonly when example.com and www.example.com points to the same application and hosted by the same server. To avoid maintaining two different records, it's a best practice to create an A record for example.com pointing to the server IP address and a CNAME record for www.example.com pointing to example.com

Bypass subdomain limit by hosting own DNS server

The following is more theoretical than practical, I want to test if I have understood the DNS system.
I'm currently renting a domain, lets call it example.com, from a provider.
I also own a server with a static ip.
Using the webinterface of my domain provider, I created an A-Record for my domain to point to my server.
Now everyone pinging example.com will find that A-Record (that should distribute itself to serveral more DNS servers) and thus ping my server.
Now I want a subdomain, which points to a different ip address.
My provider on the other hand won't let me create subdomains.
I can simply host an own DNS server at example.com, where I can add (arbitraryly) many records for any domain that is a subdomain to example.com (so not only subdomain.example.com but also subdomain.subdomain.example.com).
Now, if someone pings subdomain.example.com the following will happen:
They go to their favourite DNS server, which has an entry for example.com by now (due to distribution, see above)
Since there is no entry for subdomain.example.com, the will send an DNS request on udp port 53 to the A-Record ip behind example.com (my server)
My server will reply with the correct ip of subdomain.example.com
They send their ping to the correct ip
Is my understanding correct?
It's not far off, but there are more subtle things under the hood. If you want to host your example.com zone yourself, then you need to have your parent (.com) have NS records that point to your nameserver on your static IP. You would need to register that within your parent through your registrar that you bought the DNS registration with.
.com would need to host:
example.com. NS myns.example.com
myns.example.com. A YOURIP
And in your zone running on your machine, you would need something like:
example.com. SOA ....
example.com. NS myns.example.com
myns.example.com. A YOURIP
subdomain.example.com A SUBDOMINIP
If "subdomain" (your wording) is actually supposed to be in another zone enirely, then you need to use NS/A records to point to its DNS server (which can be the same).
You might go look for a good tutorial about how the DNS works in general. It will take you a lot further.

Joomla showing IP instead of domain name

I am hosting my own website on a Proliant Rack server using Internet Information Services. I have configured everything; port forwards, IIS, and also my Content Management System, Joomla. I have also registered a domain, www.example.com (not the real domain obviously) with godaddy. I have also gone into proliant iLO and I have set the server FQDN to www.example.com. Finally, I forwarded the domain in godaddy to my public ip. However, when I enter in the URL (www.example.com) into a browser (outside of my network), it simply shows my IP address. My host file is as follows:
127.0.0.1 localhost
127.0.0.1 example.com
127.0.0.1 www.example.com
Any help is appreciated. Thanks!
You need to add a site and bind its host name to your domain. Otherwise, IIS doesn't know what the domain point to.

When Nameservers are mapped, my domain redirects to the IP provided

I have setup a wordpress website on Digital Ocean. I have domain registered on GoDaddy. I have created domain from Digital Ocean and mapped the name-servers to GoDaddy. But when I enter the url, it just redirects to the IP and IP is shown on address bar instead of domain name.
Is there anything else should I add?
Assuming that You are using DNS servers provided by DigitalOcean and mapped your droplet's IP to your domain, You need to add the following Name Servers in Your GoDaddy Configuration:
ns1.digitalocean.com
ns2.digitalocean.com
ns3.digitalocean.com
If it is still Redirecting to Your IP address then make sure in Your Apache/Nginx Vhost Block, there is no redirect defined in them.
Also, you are running Wordpress then it is possible that you had set up your site's URL as IP address, it might be the reason for redirect, if it is then make sure to change it from wp-config.php
You can find more info here: https://codex.wordpress.org/Changing_The_Site_URL
Hope this Helps!

DNS: forward root domain to www... when there are other DNS subdomains

I currently have a DNS setup where all content and applications are hosted on the same cloud server - example.com.
The presentation website is on example.com, www is forwarded to example.com with a CNAME and then various internal apps, eg app.example.com, are also forwarded with CNAME records to example.com. NGINX running on my server takes it from there, routing subdomains to the different apps.
I'd like to host the presentational website on an external service, and I'm confused about how to update my DNS config - specifically what to do with my A record.
I'm ok with creating a CNAME for www that will forward www.example.com to my external hosting service. But example.com is still pointing to my own server... and if I have understood correctly, if I forward example.com to www.example.com, then all my apps at eg app.example.com will break.
What are my options for handling this ?
My idea (from searching around) is that if I want example.com to point to an external service, then I should
1) create a new domain api-example.com whose A record points to a server where all my apps are hosted
2) make CNAME records for all my app subdomains on example.com which point to api-example.com
3) forward example.com to www.example.com, and forward www.example.com to the external service.
Will this configuration work ? Is there a simpler way to get the same result ?
Your plan is fine, except for maybe one thing: generally, you can't have a CNAME record for the root (apex) of your domain. This means that your external presentation website hosting will have to provide an IP address, and you will create an A record that will point example.com to that address. Then you can have a CNAME record simply aliasing www.example.com to example.com.
Also make sure that you leave enough time between the steps, to make sure that all DNS TTLs expired so you don't encounter DNS caching issues.
For explanation (and possible workarounds) for domain apex CNAMEing issue, look at https://stackoverflow.com/a/33027309/1145196

Resources