DNS Setting for web URL with no prefix (with HA proxy + C Name) - dns

I have a domain vdigitalassetbroker.com that is currently configured on the DNS records (via GoDaddy) as a CNAME (www) pointing to the HA Proxy Load Balancer (haproxy-dmz-staging-1493101238.eu-west-2.elb.amazonaws.com).
As such, users are able to access www.vdigitalassetbroker.com. The site is also correctly configured with an SSL certificate.
However when the user accesses the site without the prefix (https://vdigitalassetbroker.com) – i.e. without www, the site does not load (and times out after some time). I've tried alternative derivatives of A Name and C Name - but does not solve the problem.
End User Devices tested on:
Tested on web browsers as well as mobile devices
https://www.vdigitalassetbroker.com (Works)
https://vdgitalassetbroker.com (Does not Work)
Valid SSL Certificate:
Yes
Possible solutions I am exploring:
Changes to be made to DNS only
Changes to be made to DNS and HA Proxy
Transfer the DNS to another provider or utilize Route 53 + Go Daddy
Limitations:
Setting up a wildcard A Name “A NAMES” can only accept IP addresses, and as we are using a public facing HA proxy domain (which has multiple IP addresses), an A Name (with wildcard cannot be used).
Setting up a # A Name Does not Work (A Name # with HA Proxy) – requires IP address for A Name, cannot use HA proxy domain name
Setting up a * C Name Does not Work (* Name with HA Proxy) – requires IP address for A Name, cannot use HA proxy domain name
Setting up a # C Name Does not Work (C Name # with HA Proxy) – Requires valid www type name
Setting up a * C Name Does not Work (* with CNAME > HA Proxy). Creates the record but does not solve the problem

Related

Connect Domain to Host

I think I have just successfully connected my domain to my web host and have done so by following an article. There seems to be 2 different ways of doing so and I wonder if there is a difference between the two.
method 1
Go to your domain provider. Create an A record that points to your web host's ip address.
method 2
Go to your domain provider and edit the nameservers according to what your web host indicated. Go back to your web host and add a DNS record indicating the domain.
I have followed method 1 and it works. Is it any different from the second method? In addition, when typing out a record at the domain provider, what does #, www, and * mean?
The A record maps a name to one or more IP addresses, when the IP are known and stable.
# * are same as known as domain name (e.g. yourdomain.com) some domain registrar using # instead of entire domain and some uses *. In hosting control panel under DNS records there domainname is mentioned instead of # OR *
If you work with method 1 and changing A record then you will have to change A record to WWW as well to work your domain with www else your domain with www will ended up with no result. You will also have to change all required records such as CNAME (if you have any subdomain), mail (if it is working through hosting provider).
So best practice is to use namererver so you don't need to change every record under Domain Control Panel.

How to add subdomain entry

I have a domain name (somename.com) registered at godaddy and i am using godaddy DNS Manager. But i am hosting my website with hostinger.com. So i have created a subdomain (sub.somename.com) on hostinger which by default points to same IP as a domain.
Now i have entry on godaddy DNS for my domain and subdomain name which points to hostinger server address where my website hosted. But when i access my subdomain (sub.somename.com) it goes to my somename.com. I have to refresh it to load sub domain page correctly.
Godaddy DNS Entry
domainname -- somename.com -> IP address of hostinger.com
subdomain -- sub.somename.com --> IP address of hostinger.com (same as above)
Hostinger DNS Entry
subdomain -- sub.somename.com --> IP address of hostinger.com(same as above)
Is above entries is correct ?
Should we need to have entry for domain and subdomain both on godaddy DNS ?
Do we need to have a entry for subdomain in hostinger.com also ?
In order to create a subdomain correctly you have to go through 2 steps:
1. Update your DNS records, so they accept your subdomain (sub.somename.com).
You should have these records for your setup:
A: # -> IP of hostinger.com (this is to connect the domain with hostinger)
A: sub -> IP of hostinger.com (only put the subdomain name)
CNAME: * -> somename.com (so that everything before somename.com goes to somename.com)
CNAME: *.sub -> sub.somename.com (so that everything before sub.somename.com goes to somename.com)
There are different types of DNS Records, the one's you mentioned are all A Records, you have to use CNAME Records as well.
2. Creating a virtual host (on the hosting provider)
The previous step was so that the Domain Name Servers know to which ip to point when the subdomain is used. From this side we have to point the subdomain address (sub.somename.com) to a specific folder that contains the different website. Most host providers, when you create a subdomain automatically create a new folder you can put your content at and point at it.
So to answer your questions.
No you have to change your DNS Records so they match the information above. Let me remind you that changes in the DNS Records might take a while to take effect (1-2 hours).
Your DNS entries should be at one place. Usually they are provided by the hosting provider (hostinger in this case), but since they are also provided by GoDaddy as well feel free to update them there.
There is no need to have a DNS entry in hostinger if you update them in GoDaddy.
P.S. Since I haven't used hostinger before, feel free to update me if you have more info, like if you're using CPanel.
If you intend to host a subdomain at an IP different than your main site, the records should look like this.
Main Site (mysite.com)
Type: A
Name(Host): #
Value(Points To): 192.168.1.1
Blog Site (blog.mysite.com)
Type: A
Name(Host): blog
Value(Points To): 192.168.1.2
As a reference, you only need an A record to host a subdomain. CNAME record is an alias. www records are usually CNAME records to the root domain as they are the same page.
Hope this helps!

SSL domain does not match ec2 DNS name

My website is hosted with Firebase Hosting, and I want to make a http post to a NodeJS process running on AWS EC2 instance.
First fail: EC2 was http, I had an error of mixed content (https and http).
Next, I put in a load-balancer in-front of the EC2 instance, and installed my domain certificate (www.mydomain.com)
Second fail: I get an ERR_INSECURE_RESPONSE error, as loadbalancer.amazonaws.com does not match www.mydomain.com
I am at wit's end in resolving what I think is a straight-forward use-case. Please help.
Two options.
You need to register your domain with Amazon, so you can create a Hosted Zone in AWS Route53. There, you can create a record to point "mydomain.com" to your load balancer.
The other option is with your current register (GoDaddy or someone else), to Forward your domain to your load balancer. You will probably need to enable "Forwarding with Masking" so it still looks like your domain, but is served by the AWS load balancer.
Let me know what works (or doesn't) and I'll update this answer.
You are getting the ERR_INSECURE_RESPONSE error because you are using a CNAME which is resolving to loadbalancer.amazonaws.com. Since your certificate is for www.yourdomain.com, it is giving a valid error. CNAME and Alias operate slightly differently. With a CNAME the traffic is not a valid alias of your domain so if you're trying to secure it, you will receive errors. However, when you create an A record for www and alias that to loadbalancer.amazonaws.com now any traffic from loadbalancer.amazonaws.com on www.yourdomain.com is valid traffic for your domain and you will no longer have those errors.
In order to terminate secure traffic for www.yourdomain.com at loadbalancer.amazonaws.com you need to have an A record that will alias there. Unfortunately, ELB's only provide a DNS entry, no IP address, but many DNS providers (ie GoDaddy) will not allow you to have a DNS A record that is aliased to a DNS address; they require you to alias to an IP address. Which makes life a bit more complex.
There are a couple ways to accomplish this (URL forwarding and masking is not supported by SSL), but the easiest solution is to use Route 53. Use of Route 53 doesn't require you to register or transfer your name to AWS and a hosted zone is just $0.50/month per domain.
To use Route 53 follow these steps:
Create a Hosted Zone for yourdomain.com. When you create a Hosted Zone in Route 53 it will complete a few default records (like an A, NS, and SOA records). Note the NS records as you'll need them later.
Next copy your existing zone file entries (like MX records) from your current DNS provider to your new hosted zone.
When it comes to a record that you want to direct traffic for to your ELB you'll enter the name, say www, and then just below the type option field you'll see a radio option that says "Alias: yes no". When you select yes, the value field will disappear and you'll see an option that says "Alias Target: Enter Target Name". When you click that field you'll receive a drop down list of resources in your account that you can alias to. Simply select your load balancer.
Click create, and you're done with Route 53.
Now that all your dns records are copied over, and you'll go to your registrar and change the nameservers to the ones that Route 53 provided you.
Now Route 53 is handling your DNS for you. And loadbalancer.amazonaws.com is a valid alias of www.mydomain.com. Since loadbalancer.amazonaws.com is now a valid alias of www.yourdomain.com when you visit www.yourdomain.com your ELB at loadbalancer.amazonaws.com will terminate the traffic as www.yourdomain.com and your error will be resolved.
Side note: If your instances are in us-east-1 you can get an unlimited number of free standard, SAN, and wildcard SSL certificates for your ELB and domain using Certificate Manager.

How to map domain to hosting server

My client have a dedicated server on liquedweb cloud service and we my web app is hosted on that server. We want our users to map their domain to our server. So they can enjoy our web app by using their domain name. What information I need to provide to my user so he can map domain and what information I need from them?
I don't know much(in fact anything) about domain mapping
thanks
It depends if the server has a dedicated IP address or is natted.
If the server has a dedicated IP address you can ask your clients to point their entire domain to you server by adding the following A records:
Host TTL Protocol Type IP Address
# 300 IN A 1.1.1.1
www 300 IN A 1.1.1.1
Not all domain hosts ask for TTL,if not dont worry about it.
If you want just their subdomain to point to your server (subdomain.website.com)
subdomain IN A 0.0.0.1
TTL is optional in some systems, in this case the default will be used.
Generally it is recommended that you use an IP for the Apex record and not a domain name. EG: example.com is the apex, www.example.com is the www subdomain.
A typical configuration would be below:
Host TTL Protocol Type Result
# 300 IN A 1.1.1.1
www 300 IN CNAME example.com
This is the same config as the top example but using CNAME example.com. It is the same as using A 1.1.1.1, it just means you only need to change one record.
If your server details are a hostname and not an IP address, most systems will not let you use the hostname for the apex so you will need to find out the IP address. (A simple method is to use the nslookup command or dig command).
TTL is how long in seconds a record last before it expires. If you are unsure what you are doing I recommend lowering this so you can correct mistakes more quickly.
Different methods for the different servers. For most of the servers, you have to change the nameservers of your domain.
This mostly needs when your domain registrar and hosting provider both are different.
First Login into your hosting account, navigate to the account details,
then copy the nameservers from there...which would be like :- dns1.hostingprovider.com
dns2.hostingprovider.com
After that, Go to control panel of your domain. Navigate to the nameservers
You will see the link:- dns1.domainregistrar.com
dns2.domainregistrar.com
Paste the above links at the place of below links.
They need the IP address (and possibly instructions on how to configure their DNS servers (which means a variety of different sets of instructions for different servers and control panels)).
You need the domain name.

Customers are pointing their domain to our fix IP (web server). How to reroute via CNAME?

We have a web platform that is used by customers from all over the world. We also offer a white-label solution where customers can use their own domain to use our services.
Many point their own domain address by:
a) setting the nameserver to ours - we then do the rest (pointing it to our IP)
b) setting A records to point our fix IP address X.X.X.X directly (this IP belongs to a virtual apache server were our application runs).
FYI: We have full access to DNS.
We'll soon move to Amazon Web Services (Elastic Beanstalk) and are therefore preparing the transfer. During the transfer we want of course the least downtime possible resp. the domains to be showing to the new server address as fast as possible.
Customers a) are easy to handle. We simply set CNAME to point the Elastic LoadBalancer (ELB, no fix IP given thus CNAME) and they will be redirected promptly.
Customers b) though seem to be more complicated. Is there a way to reroute to CNAME -> ELB?
Example:
Given: Customer b) points his domain sub.customer.com directly to our IP X.X.X.X.
What we did: In DNS we opened a new hosted zone for "customer.com" and put CNAME -> ELB for sub.customer.com.
This does not work. What can we do to have sub.customer.com redirected to CNAME (ELB) without changing URL? Maybe with .htaccess or with other DNS modifications?
PS: We are doing this because we can forsee that lots of customers will take ages to change from "A record -> old IP" to "CNAME -> new ELB".
If the customer controls the A record, the customer must change the A record. In this case, the customer most likely controls the NS records upstream as well, so nothing you do on your DNS servers will have any impact at all on the customer's actual domain. You can redirect at the IP level using a tool such as ipf (Debian family) or iptables (Red Hat family) or it's equivalent, but you will have to be very careful in just how you implement that.

Resources