How to setup a subdomain DNS proxy? - dns

Hello I will get a access to a subdomain division.company.com and I will have to name where to point it in contract. I don't want request for contract update because where subdomain has point to every time I need to switch a server.
I am looking to have a top level DNS like control for a subdomain.
a) Do I use some kind of routing/proxy server?
b) Is there a way to have a dynamic DNS assignation (single time minimal configuration on the top level domain side)?
c) Is what I am looking for possible with DDNS providers like https://www.dynu.com/ ?
I tried using dynamic with a test domain but it did not seam to function properly.
On test domain I added CNAME DNS record b.a.com pointing to b.dynamicdns.com and then on dynamic DNS'es DNS records I pointed a CNAME record of www.b.dynamicdns.com to a website's server then on website server side I tried www.b.a.com but it did not seam to work.

Top level domains has to add NS (name server) records for the subdomain pointing to a DNS management provider
https://www.dynu.com/ has and add own domain where subdomain can be entered and configured but other providers should work too.
NS b.a.com NS1.provider.com
NS b.a.com NS2.provider.com
That will delegate subdomains DNS record management to it and will allow for full control of it. Including adding CNAME records pointing to any server.

Related

Different name servers for different subdomains

Let's say I have a website example.com which I bought via a common domain registry nomcheap.com.
I want all traffic to a specific subdomain app.example.com to go to name server ns1.appserver.com so I can serve a specific user app.
I also want all other traffic (www.example.com, hello.example.com, *.example.com, etc.) to go to a different name server from a different provider ns1.squaresites.com so I can serve a general website (think something like a commerce Wordpress site).
None of the name servers are provided by the original domain registry nomcheap.com.
Is this possible? If so, any suggestions on how?
To point a subdomain to a name servers you need to create an NS record for the subdomain:
app.example.com NS ns1.appserver.com
This will make all queries go to ns1.appserver.com
*.example.com NS ns1.squaresites.com
The second record should catch all subdomains that don't have their own records (of any kind).
Delegating name server DNS responses can be done was the answer by #Lanexbg describes.
Realize that chaining your DNS lookups this way adds more time to DNS resolution and adds another potential point of failure in the resolution process. If the parent's name servers are down, they won't able to deliver the NS records to tell the client's resolver to continue the lookup process through a delegated name server.
Consider if using DNS "A" or "CNAME" records at the parent's DNS server would be acceptable alternative.
For more detail on how DNS resolution is delegated see this answer on serverfault.com:
How exactly should I set up DNS to delegate authority for subdomains?

Having problems creating MX records for subdomain on dreamhost.

I have a domain on dreamhost, say block.com. This domain points to an address outside of dreamhost (amazon AWS).
I also have a subdomain, us.block.com that is hosted on AWS. This subdomain is not registered on dreamhost (as dreamhost doesn't allow subdomains to be hosted outside of dreamhost). To point to this subdomain, I've added in a couple of custom A records to the DNS records on dreamhost.
Since the subdomain is not registered on dreamhost, it doesn't allow me to add custom MX records. Is there anyway to get around this? If there isn't, can I somehow point the mail server of us.block.com to that of block.com without using mx records?
You can do that with a little trick:
Domains > Manage Domains
Fully host your subdomain
Under "Web Hosting" find "Remove" and press it
Now you can edit custom MX fields for your subdomain
Tested solution from here

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!

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.

Rails 3 Custom Domains A Record vs CNAME

Could someone explain the difference between an A Record and a CNAME, and what I should be telling my users to do if I am building a site that allows for custom domains to point to a subdomain on my hosted service?
A record... www.rabbot.com -> 123.123.123.123 (ie. an actual IP address)
CNAME record... www.philip.com -> www.rabbot.com (ie. more like an alias)
Your life will be much simpler if you have your users to use a CNAME as they can point their domains to yours. Then if you need to update your server's IP address you can simply update the single A record you have instead of making all your users update their DNS entries.
This is true regardless of what web framework you are using...

Resources