How to point DNS at a dynamic IP address? - dns

Bluehost is my DNS provider and my app is hosted on heroku. I'm trying to point the DNS at my heroku app but there's an issue. Heroku's documentation states the following:
Some DNS providers will only offer A records for root domains. Unfortunately, A records will not suffice for pointing your root domains to Heroku because they require a static IP. These records have serious availability implications when used in environments such as on-premise data-centers, cloud infrastructure services, and platforms like Heroku. Since Heroku uses dynamic IP addresses, it’s necessary to use a CNAME-like record (often referred to as ALIAS or ANAME records) so that you can point your root domain to another domain. See examples below.
They go on to recommend creating a CNAME record with the values # and your root domain alias, e.g. hidden-sierra-7936.herokudns.com.
But Bluehost won't allow this because they want an IPv4 IP Address only and won't accept something like hidden-sierra-7936.herokudns.com as a valid CNAME record. I've already done the www record and things aren't working, so I'm guessing I need the ANAME record as well.
Is there any way around this other than switching to a new DNS provider?

Bluehost does not support this. Google and Cloudflare do, perhaps others. Cloudflare worked for me.

Related

Nodejs - What does it actually means to deploy a website on a domain and how to do it?

I am a bit new to the deployment of a website. I have a server which is written in Node.js. Previously I had been using Heroku for deploying my apps without knowing much about deployment. I would like to know how do I deploy my server to create a website which has .com at the end of it like www.example.com and not www.example.herokuapp.com. I think it has something to do with domains (correct me if I am wrong). I would like to know what exactly is a domain and a DNS provider and how to deploy a website in such a way. Thank you.
You should ask one question to yourself when you hit www.example.com in browser how does it load a page?. When you run a website on your laptop it basically runs locally, if you want to access your website over the internet you would require public IP(host or server) accessible over the internet so you can access a webpage using public IP:port. But this is not the best option because IP may change in the future and also remembering IP for each application will be difficult. Imagine if you access Facebook, Instagram or any other websites by its IP addresses how difficult and inconvenient would it be? There are a couple of things you should know.
DNS-> Domain Name system
Every host is identified by the IP address but remembering numbers is
very difficult for the people and also the IP addresses are not static
therefore, a mapping is required to change the domain name to IP
address. So DNS is used to convert the domain name of the websites to
their numerical IP address.
DNS is a hostname to IP address translation service. DNS is a distributed database implemented in a hierarchy of name servers. It is an application layer protocol for message exchange between clients and servers.
Name servers
Domain Name Servers (DNS) are the Internet's equivalent of a phone book. They maintain a directory of domain names and translate them to Internet Protocol (IP) addresses. This is necessary because, although domain names are easy for people to remember, computers or machines, access websites based on IP addresses.
DNS record
A domain name, IP address what is the validity?? what is the time to live ?? and all the information related to that domain name.
Once you understand the DNS
Host(Deploy) your website to Amazon EC2 or Heroku and obtain Public IP.
Buy a domain from domain provider like Godaddy
Map domain(ie www.example.com to IP)-> DNS record
Mapping domain to IP may vary platform to platform but the Core principle remains the same. I would suggest you these below link. Try to find differences in both, doing so you will learn along the way
http://www.littlebigextra.com/map-domain-name-amazon-aws-ec2-instance/
https://medium.com/progress-on-ios-development/connecting-an-ec2-instance-with-a-godaddy-domain-e74ff190c233

Cloudfront setup for main domain without using route53

We are planning to use cloudfront distribution for our main domain and the setup will be as follows.
Cloudfront Origin - route.domain.com -> Remote Server IP address(xx.xx.xx.xx)
www.domain.com, domain.com -> d123.cloudfront.com
As we know, we can setup CNAME for www.domain.com to point to cloudfront distribution(d123.cloudfront.net). However, for domain.com we should point A record to IP address and its not possible to setup CNAME record.
In route53, there is an option called Alias which can be used to point the domain to Cloudfront. But, our domain.com nameserver uses different provider and we would like to stick with current nameserver.
Any help would be appreciated.
Since this is a limitation in DNS itself, there is no way to accomplish this without a DNS hosting provider that supports an alias-like feature, sometimes called an "ANAME" or "flattened CNAME". Route 53 is of course the canonical example. CloudFlare and DNS Made Easy are others.
Or use a service like this one¹ to redirect your naked domain name to the www address, which would be your "real" site. They give you a single IP address for your A record. Note that your current DNS provider may have a "redirection" option that does this. It is not properly a part of DNS, but some providers allow you to configure domain redirections in their DNS portal.
Or migrate your DNS hosting to Route 53, keeping your DNS registration with your current vendor. In my mind, there is really no compelling reason not to use Route 53. See Making Route 53 the DNS Service for a Domain That's in Use for migrating to Route 53 without disruption, noting that the final step -- Transfer Domain Registration to Amazon Route 53 -- is entirely optional, as mentioned in the docs.
¹ this one is not a service I am affiliated with or have ever used in production, because I built my own service for that purpose using EC2, which is another option but outside the scope of this answer. This is intended as an example, not an endorsement.

Resolve my domain with a CDN IP

I'm not a routing expert. But what I know: It can be a really big topic. So, I'm currently thinking about geo-load balancing and how I can provide it. You can use Route 53 to create GeoDNS lookups. And this is fine and good. But I think about CDNs. I have only two location, while CDNs have tons of locations. Why not resolving my domain www.example.com with one of these CDNs IPs directly? My frontend is static. The dynamic stuff is created by Javascript. So, is it possible to resolve my domain example.com directly with the nearest CDN IP?
What you describe is quite usual setup. On AWS, after you create CloudFront distribution, you will simply create ALIAS in your Route53 console:
www.example.com A ALIAS xyz123xyz.cloudfront.net
If you are using other CDN/DNS providers, you will create CNAME record:
www.example.com CNAME xyz456xyz.somecdn.net
It is possible to resolve your domain to only one CDN IP. And when we talk about CDN IP, it is usually virtual IP (Anycast IP) where it maps to different physical edge servers globally. Depending on where the request is coming from, that virtual IP will map to the edge server closest to the end user.
Take this domain www.cloudflare.com for example, it is on Cloudflare (http://www.whatsmycdn.com/?uri=www.cloudflare.com), and it is pointing to two Cloudflare virtual IPs for failover purpose I suppose.
dig www.cloudflare.com +short
198.41.215.162
198.41.214.162
Of course, pointing that domain to only one Cloudflare virtual IP is completely doable, although it is not desireable.

Setting up a private domain for Swisscom Cloudfoundry

most domain providers don’t allow setting a CNAME record for a main domain. It’s usually only possible to set CNAME records for subdomains.
So now I’m wondering if it would be possible to set an A record instead, pointing to scapp.io’s IP address. I tried it yesterday and it seems to work great but I’m worried that IP address might not be stable.
Any ideas whether setting an A record to 194.209.246.110 is a valid option for configuring a "naked" domain?
We don't recommend A record to IP address. The IP addresses may change without prior announcement.
See docs.developer.swisscom.com -> DNS for Domains for other options than CNAME.
Configuring DNS for Your Registered Root Domain
To use your root domain (for example, example.com) for apps on App
Cloud you can either use custom DNS record types like ALIAS and ANAME,
if your DNS provider offers them, or subdomain redirection.
Note: Root domains are also called zone apex domains.
If your DNS provider supports using an ALIAS or ANAME record,
configure your root domain with your DNS provider to point at a shared
domain in App Cloud.
What domain provider do you use?

Pointing DNS name to IP address on local machine

This might be a stupid question but i would really appreciate any compact answer.
I have uploaded a Joomla site on my local machine using a static IP address (213.221.211.111 for example). I have registered a domain (like www.example.com) on Godaddy.com. Within their dashboard, I set the primary and secondary name servers (I looked it from my router setup page).
Is there any else I need to do so that entering e.g. www.example.com would take the user to 213.221.211.111.
Inside of godaddy, you need to map "www" to your static IP address. It would be a good idea to also map the default entry for your domain, sometimes called "#".
Edit: Upon further reading of your original question, you don't set the primary and secondary DNS servers for your domain to your ISP's servers. Your domain's primary and secondary servers are for the addresses of the servers that are responsible for serving your domain. Unless you have your domain hosted with your ISP and not with godaddy, then this is not the right thing to do at all. If you have your domain hosted with godaddy, follow their instructions for setting up a domain and pointing "www" at an IP address.
In addition to what jricher said, you will also probably need to port forward.

Resources