If you change your domain nameservers does that void all DNS/MX/A record you input in your domain registrar? - dns

say you have a domain (mydomain.com) in registered to a registrar, say namecheap,
you have setup MX record to handle email sent to your domain
you had setup an A record to make a subdomain use a different webhost
Name: intranet.mydomain.com
Value: 108.xxx.xxx.xx
Type: A name
now, you want to host the primary domain to a webhost, so that when a user load mydomain.com to their browser it will use webhost to load the resources
Question, the webhost requires you to update domain nameserver to use
ns1.myhost.com
ns2.myhost.com
Will updating my nameserver to my domain registrar to use the nameservers above will void/not-implement the already existing A records?
If not, how do you solve the problem?
Thanks!

In somewhat laymen's terms:
You need to distinguish between 3 different (yet related) services:
Domain name registration - you pay for your domain name here. Except for the name itself, here you need to enter your Domain Name server names, which will point to where the next service is hosted:
DNS service - here is where you enter all your records (A, MX, ...) which point to your other services (web hosting, mail servers, etc..)
Service hosting provider (for example web hosting, or email service)
You can have different parties host these services for you, but it is not uncommon that one service provider can offer all these services. From your description, it looks like that at the moment your Name registrar (1) is also hosting your DNS service (2) (which is quite common). Now, your new web hosting provider wants to host your DNS service, and is requiring that at your name registrar, you enter its name server names (which is also not uncommon). And you are right, if you do that, any DNS records that you entered at your current DNS provider will be void (they will remain there, but no end user will ever see them since (1) will point them to use your new hosting provider's name service to resolve your domain records).
You have two options:
Do not comply with your webhost's request, instead ask them what DNS records (probably A or CNAME) you need to add at your current DNS service provider in order that your new website becomes reachable.
Comply with your webhost's request, but then you will have to go to your new provider's name service console and again add all the records that you already have entered at your previous DNS provider.
I would choose option 1, as less risky

Related

I cannot access my domain after delegation in Azure

after changing name servers in my registered domain (in namecheap) which has the name for example "contoso.net" to name servers, which matches the four nameservers in my Azure DNS zone (ex: ns1-08.azure-dns.com) I could not access my website as usual , and I receive the error message, which referes to the this problem with name servers (DNS_PROBE_FINISHED_NXDOMAIN).
so, when I reset again the default name server to "namecheap web hosting DNS", then I can again access the website.
can anyone help? thanks!
When you change the name server for that domain to Azure provider name server, actually you have delegated that domain to Azure DNS name servers and you could edit your DNS records in the Azure DNS zone.
In this case, you need to add A or CNAME records mapping to your website's hostname or IP address in your original domain provider, then you will access websites again. Usually, it takes about a few minutes or hours for the DNS propagation. If you still could not access the websites after verifying the DNS update, please clear the cache or type ipconfig/flushdns on the windows command prompt.
References:
https://learn.microsoft.com/en-us/azure/dns/dns-domain-delegation
https://learn.microsoft.com/en-us/azure/dns/dns-web-sites-custom-domain

Programmatically Connect domains to servers

I want to create a simple web app. where user can have a form to add domain and directory name( that is already created on our server ). And it simply starts pointing the domain to that directory. What apis should I need for this? Hosting and domains can be bought from same brand, like GoDady.
Cloudflare has an API to add DNS records.
However, if you go this route, these are the prerequisites:
User's domain must already be activated in Cloudflare. At least partial-setup with Cloudflare's hosting partner (Siteground etc which have Cloudflare integrations built-in) or full-setup (the domain's authoritative nameserver points to Cloudflare).
User must trust you with their email address linked to their Cloudflare account and their Global API key.
Your web app can then make the API call to the endpoint and Cloudflare will create the appropriate DNS records to point to your server.

What's the role (if any) of the original DNS registrar once a domain name has been delegated?

Let's say I register the domain name mydomain.com using GoDaddy (or any other registrar). Then I immediately delegate the domain to Azure (i.e change the NS records for the domain to point to Azure's name servers). As far as I understand I would then use Azure's DNS admin tools exclusively to add/change/delete DNS records fot my domain.com.
But do I still need to have any type of relation with GoDaddy (or whichever registrar I used to register mydomain.com)? For example, if I would like to delegate my domain once more from Azure to some other nameserver would I do this through Azure or GoDaddy? Or when I need to renew my domain name, would I have to do this through GoDaddy? Or if my GoDaddy account is hacked, would mydomain.com be at risk somehow? Or would GoDaddy be involved with mydomain.com in some other way I haven't considered?
The registrar is still key in almost every situation.
They are the people you pay your subscription/fee for the domain name (normally every few yrs depending on the domain).
They are the 'tag' holder (in the case of .uk names some info here) which means they are the ones you have to approach if you wanted to move your actual name (and payment) to another registrar (e.g if you decided you didn't like GoDaddy any more you could move to Namesco, or someone else) .com domains have a similar setup
Renewals and any changes to the account or domain name would go via the registrar - this includes any further/new delegation you might do.
If your registrar account gets hacked then anything associated with that account is 'at risk' this includes the hijacking of the domain name to be pointed anywhere.
Your registrar is usually the controlling name server (Check the whois records) so any query would hit them first before any delegations you have in place.
You talked about further delegation of your domain; so presuming one day you decide to move from Azure to AWS (say) then you would go back to your registrar portal and update the NS records to point to your new IP(s) on your new host.
You can either you manage all your DNS via your registrar, or delegate the NS records (as you have already) and run your own DNS Server. In your setup you use the Azure (or whatever) tools to manage your actual records, but you would need to go back to the registrar to manage the NS records that controlled the delegation of the domain. You should note that not all registrar will allow the delegation of NS records and in effect 'force' you to use there own portal/DNS tools so check carefully.
The short of it is - you still have and must maintain any relationship
with the registrar.

How to connect existing hosting account with new domain

i have bought a domain(adspace.lk) and hosting from the same service provider (lankahost.net). but now my domain has expired and my hosting account is still available with all my files.
now i have bought another domain (.com) at name.com .i want to connect my new domain name.com to the existing hosting account.
Is there any way to do it.
sort of, yes. Assuming that the machine you're hostin your files on has an ip address set aside for your exclusive use - that is, not "shared" hosting - you can simply create an A record with the new new, and that ip address. You must also change your webserver config - if you're using any web related stuff - such that the webserver can associate your web site files with the new name. Usually, a web host can have multiple names at the same time, so you could simply add a new name to the existing configuration.
It's hard to answer without knowing the details of your domain and hosting settings, but I'll try to give a generic but hopefully useful answer.
You should first get the ip(s) of your hosting. Then point the new domain to that ip(s) using the dns panel provided by the registrar. If you use your own dns (unlikely), set the ip there.
After this, you should configure some rules on your hosting. It's likely that you have to set some sort of virtualhost settings. In particular, you should associate the new domain name to the hosting: probably the hosting service provides you a control panel for this task.
It will be done easily from your domain control panel, just update your dns settings for your new domain name.com. Update your nameservers or A record to point the hosting account. So that it will be linked with your existing hosting account files.

automatic sub-domain registration

I'm new at DNS world, did some readings in the Internet and wanted to know if I came to the right conclusions. I want to build a system where users are able to create new sub-domains of existing registered domains automatically:
My system provides services to different companies, these services are hosted in my system or some cloud provider. Lets call my system "services" and some company "company1". I want to offer "company1" my services and have its users access these services through "company1" new sub-domain, when "company1" has an already registered domain company1.com. I want "company1" admin user be able to control and choose the sub-domain via my system when he registers his company in my system, and have the whole thing automatic. If i understand correctly:
if the admin would want to use a sub-domain like services.company1.com this will be a problem since I would need to update the authoritative name-servers of company1.com which I don't know who they are, and even if I have a way to know them (and from reading a bit I see that I do have a way), I don't know if every such name server will allow such updates from some external source, connectivity issues etc
if the admin would like to use a sub-domain like company1.services.com then I can achieve this by having my own dns server which I will register the services.com domain for and actually manage all these company sub-domains in my own dns server. This means though that all companies will have to have a sub-domain under my domain services.com
Please correct me if I have a wrong view on how DNS works.
thanks!
services.company1.com
To provide this kind of domain name to your customer, you will need their collaboration. A lot of companies provides this kind of feature by asking you to point an alias (CNAME Record) to a specific server.
Examples of concrete usage
blog.company1.com. 3600 IN CNAME domains.tumblr.com.
shop.company1.com. 3600 IN CNAME myapp.herokuapp.com.
git.company1.com. 3600 IN CNAME bitbucket.org.
Here's some links to the documentation of companies offering this feature:
BitBucket
Heroku
Tumblr
Sample client zone file
So in your case your customer DNS zone will contain something like that:
services.company1.com. 3600 IN CNAME domains.services.com.
where domains.services.com. will be the server that handles the subdomain authentication
company1.services.com
To provide to your customers company1.services.com, you don't have to manage your own DNS server, you just have to be able to add a wildcard record to point all the subdomains to your application. It will be the role of your application to filter your service per subdomains.
Sample service zone file
For example (where 0.0.0.0 is your service IP address):
*.services.com. 3600 IN A 0.0.0.0

Resources