How to add provider specific entries using dnscontrol? - dns

I am trying to configure my domain's dns records using dnscontrol
There is a DKIM TXT record that is over 255 characters. Route53 and Google Cloud DNS requires the record to be split into multiple strings, but CloudFlare does not support multiple strings for TXT records.
I tried adding a separate D('mydomain.com', REG_NONE ...);, for cloudflare, but it is failing with error
Executing javascript in dnsconfig.js: mydomain.com is declared more than once
How can conditionally add records depending on the provider with dnscontrol?

If different providers have different DNS records things are going to get very confusing very fast. We don't recommend it.
Usually the only thing dnscontrol will do that is similar is a meta type like ALIAS() which does different things for different providers. That won't help in this situation.
My recommendation is to not use CloudFlare until they support multiple strings in a TXT record. Have you filed a feature request with them?

Related

How can we add multiple TXT record using host as # in Domain Dns?

I am not good at DNS configuration. I did some research on this topic. but it seems am unable to find the best way to set up the multiple TXT records using the host as # in my domain DNS configuration. I was able to add aws TXT record but now I am trying to add Facebook and Google domain verification code in the TXT record in a host as #. I added it with DNS configuration but Facebook and Google are not verifying my domain.
I tried added with a meta tag and HTML file but nothing is works well. Is there any suggestion from you folks will appreciate it.
Cloudflare might be an easy way to do this, they support multiple TXT records in the root of the domain, or atleast, I haven't had any problems with it. There are also other alternatives like ClouDNS or deSec.
Almost any DNS provider should support multiple TXT records in #.

How do I return dynamic TXT records based on wildcard subdomains?

For example, I'd want foo.example.com to return the following TXT record
foo:bar
This might be a language agnostic question meaning that you'd have to resolve dns lookups on your server, but I'm curious as to how I would tackle this challenge using node.js. The bar part of the TXT record would be returned from a database; not sure if that throws a wrench in the whole ordeal.
As the discussion above suggests, you will need a way to programmatically set DNS subdomain.
Once you have the text records in place, your Node.js app can use npm openalias to get cryptocurrency addresses

How to return the same DNS records for all domains?

I have a random number of domains (sub.client1.example, sub.client2.example, etc.) that I ask my clients to delegate to my name servers through a NS record.
The configuration for every delegated domain should be exactly the same (a CNAME to a fixed domain that we own and a record for SSL validation).
How to configure my DNS servers to accept requests for any domain name and return the correct configuration for it? Is there a hosted service like Route53 or DynDNS that would provide vanity name servers with support for that use case?
You are not saying with which nameservers.
With most of them, like Bind, you can write your zonefile in such a way that the domain name itself does not appear in the labels.
Basically you write www CNAME www.whatever.example and the missing dot at the end of www forces the nameserver to automatically add the domain name.
So with a zonefile written like that, you can configure your nameserver for all domain names it should be authoritative on and use that same exact zonefile.
This is one among many other options.
To be a little more on-topic for this programming Q&A website you could also:
use a nameserver that allows to use as source, instead of a static text file, content of a database (that some program of yours could fill in) or even directly a program that will get called to reply to each DNS packet
use some templating mechanism and some program to build all zonefile text files from other sources (like a database) before starting the nameserver.
Note that the first case with a "generic" zonefile text file is by far the easiest so that should be your first try.
Of course various providers on line could give you the same features more or less, starting with your registrar that could give you DNS hosting also. But it is also achievable by yourself if you agree to install and maintain a nameserver.
Also, you do not need any vanity server to do all of that, and I recommend you to just not follow that leads as it will not give you any kind of benefit.

Are *.jpg.to style wildcard subdomains a burden on the DNS system?

I noticed the service http://jpg.to/ supports any word, e.g. http://car.jpg.to/. Curious if this kind of thing is a burden on the DNS system, due to all the names that must potentially be stored, and therefore considered poor practice. Not picking on jpg.to, but just curious because I haven't seen anyone mention the issue when it's been covered.
Is it acceptable for a service to establish many thousands of subdomains?
This is wildcards.
DNS servers for jpg.to contain only one record, like this:
*.jpg.to. A 107.20.205.231
When client asks for any domain which ends with jpg.to (for example car.jpg.to), DNS server on-the-fly "generates" an answer like this:
car.jpg.to. A 107.20.205.231
As you see, there is absolutelly no additional burden on the jpg.to DNS servers, on the contrary it have to store only one record.
Although, (for those not familiar with the topic), DNS system built in the way that there are intermediate, "caching" DNS servers. They will cache the actual answer like car.jpg.to, and not a wildcard. Thus once people query lost of different domains under jpg.to, caching server will store many records.
There is nothing wrong with using wildcard DNS. Wildcards defined in the internet standards (RFC 1034 section 4.3.3) and this little additional load is part of normal operation of DNS infrastructure.
Wildcard domains are exactly that – wildcards.
They don't use any more spaces that a normal DNS entry.

Subdomains and DNS

I currently have my own domain name and dedicated server and I offer different packages to my clients. What I want to be able to do is have them sign up with my website and create a package automatically that they can access via their username as a subdomain e.g.
http://yourusername.mywebsite.com
I currently have DNS entries set up for various subdomains with real information for my website e.g.
Name Type IP Address
# A 1.2.3.4
bugs A 1.2.3.4
support A 1.2.3.4
However, if a new customer signs up at the moment I have to go and manually create an entry for them with their username in it.
I'm sure I've seen websites that manage to do this automatically, does anyone have any ideas how, or any other methods that I should be using?
Thanks,
Mark
Since you apparently do not control the name servers, your choices are quite limited. One possibility is to use a wildcard DNS record:
* A 192.0.2.1
where the star will replace every name. Not ideal (inexisting domains will also appear).
The details depend on which DNS server you're using.
One approach is to have some code that opens the DNS zone file and adds the desired records. On Linux with Bind, you will then need to signal the server to get it re-read the zone file.
With Simple DNS Plus, you can easily add such a DNS record through the included HTTP API. For example:
http://127.0.0.1:8053/updatehost?host=yourusername.mywebsite.com&data=1.2.3.4
Since you apparently do not control the name servers, your choices are quite limited. Nevertheless, every serious DNS hoster provide you with a API (see for instance Slicehost's API). So, you may use this API and write a small program to update the DNS data.
(Foot note: handling paying customers when you do not even control the name servers seem... bad)

Resources