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.
Related
This is a code example from MSDN: getaddrinfo.
You can use "baidu.com" and "www.baidu.com" to test.
Because baidu.com and www.baidu.com are different addresses!
www.example.com is registered in DNS with an A type record (or a CNAME, which points to an A record - this is slightly simplified) An A record is a name, in this case www that points to an IP Address 12.34.56.78. (as I'm sure you already know!)
example.com can also have an A record registered (though not a CNAME) this is called the Apex (or naked!) domain. example.com's A record could very well point to 123.45.67.89
A little history
Part of the reason that this came about, is that in the early days of the internet, a server would have a hostname of something like LOCUS.UC.EDU because it can be difficult to know what services LOCUS might provide. you could attach the CNAME FTP.UC.EDU to point to that machine. that way people knew what services it offered. at that point, www was just another service, it had no special place in the collective consciousness. (all of this was happening over the decade or two that the internet was developing!) but you could also quite probably want bob#UC.EDU to work. so UC.EDU needed to be a host name also
In actual fact it started with just the hostname (and host records that got telexed - I do love that fact) - but we'll ignore that for this case.
back to the facts
What usually - should - happen is that there is an A record registered at the Apex and a CNAME registered at www But there is certainly no requirement for this and you can have whatever records you wish at your domain.
I work for Johns Hopkins University, and our web culture here has been an unruled wilderness for many years. We're trying to get a handle on the enormous number of registered subdomains across our part of the web-universe, and even our IT department is having some trouble tracking down the unabridged list.
Is there a tool or a script that would do this quickly and semi-easily? I'm a developer and would write something but I want to find out if this wheel has been created already.
Alternatively, is there a fancy way to google search, more than just *.jhu.edu or site: .jhu.edu, because those searches turn up tons of sites that use "jhu.edu" in the end of their urls (ex. www.keywordspy.com/organic/domain.aspx?q=cer.jhu.edu)
Thanks for your thoughts on this one!
The Google search site:*.jhu.edu seems to work well for me.
That said, you can also use Wolfram Alpha. Using this search, in the third box click "Subdomains" and then in the new subdomains section that is created click "More".
As #Mark B alluded to in his comment, the only way a domain name (sub or otherwise) has any real value is if a DNS service maps it to a server so that a browser can send it a request. The only way to track down all of the sub-domains is to track down their DNS entries. Thankfully, DNS servers are fairly easy to find, depending on the level of access you have to the network infrastructure and the authoritative DNS server for the parent domain.
If you are able to, you can pull DNS traffic from firewall logs in and around your network. That will let you find DNS servers that are being sent requests for your sub-domains.
Easier though would be to simply follow the DNS trail. The authoritative DNS server for your domain (jhu.edu) will have pointers to the other DNS servers that are authoritative for sub-domains (if your main one is not authoritative already).
If you have access to the domain registrar and have the proper authorization, you should be able to contact technical support and request the zone file or even export it yourself depending on the provider.
How efficient is DNS second-level domain lookup? For example, in a url web.example.com, the top-level domain is .com, and the second level domain is .example. When we query for web.example.com, the root servers will provide the gTLD servers for .com. After a gTLD server is selected for .com, this server will return the nameservers for example.com. How can one gTLD know the nameservers for all each possible second-level domain (such as "example.com") since there could be so many possible second-level domains? Based on wikipedia (en.wikipedia.org/wiki/Domain_Name_System#Structure) each label is up to 63 characters, so if we limit to the english alphabet, this already gives us 26^63 possible second-level domains.
The reason is that very very few of the 26^63 domains are actually used.
Also, the DNS system is hierarchical, so once a DNS server at an ISP looked up for example cnn.com, it will cache the data and not ask the root server about it again for a set time even if other clients ask about it. After a while, many root domains are cached very near to the clients.
That is not to say that the root servers don't have their work cut out for them... :-)
Most likely (I haven't checked, but will ask when I see the main author of BIND next) they just use a standard binary tree.
A properly balanced binary tree would need to be about 27 levels deep to hold the ~100M .com domain names.
It's unlikely to use a hash table since DNS servers typically need to be able to produce a sorted zone file on demand, and hash table's aren't that amenable to producing a sorted list of the keys.
I have been using ndns to write a DNS server. It handles the low level communication and still leaves me to write up the Resource Records.
Is there a documentation or tutorial on Resource Records that should be implemented for an Authoritative DNS Server? I would very much like to make sure I don't miss anything.
Now (if it helps at all) am only looking for the basics. No zone transfers, no caching, no recursion (what caching servers do). I am only looking to respond to
A
MX
TXT (for SPF) and SPF (the new way)
and the unknowns. What am I supposed to implement in order to meet the rules, be nice, and most importantly.. compatible?
I am guessing, NS, PTR, SOA might be in order. Except I can't see how any of these are required. I am not even sure I want any of those.
I will not be using "slave" DNS servers.
I don't know why anyone would look up my nameservers except from the WHOIS top level.
I would prefer not to have a serial number if I can avoid it.
The only reason I can think of to implement PTR is to make it look pretty when I say nslookup - my-brand-new-ndns-server.
As you can see I am lost.
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)