DNS two domains one server - dns

Greetings All,
Long time reader first time poster.
I work for a small school district. We are our own SOA so we can pretty much do what we want.
In the state of Washington all educational institutions are given a name like myschools.wednet.edu. I've recently purchased a new and hopefully easier to remember domain myschools.org and I'd like to use both domains and have them point to the same information and subdomains i.e. helpdesk.myschools.org would equal helpdesk.myschools.wednet.edu. I'd also like this to work with e-mail but I think this is a bit more complicated.
I'm sure this has been done, but I'm not entirely sure I'm asking the question in a way that can be easily answered.
Any and all help is appreciated.
TIA,
Dave

To do this, you'll have multiple DNS record entries (A-Recs) pointing to the same IP Address. You may also need to tweak IIS (or your web server software) to accept requests coming from both domains.
So...in your DNS manager (e.g. in Register.com or whereever you manage your domains) change the A-Rec to point myschools.org (your domain) to the same server IP address where myschools.wednet.edu is currently pointed (I take it that you told them where to point the subdomain).
If you are using IIS then setting up multiple domains on one web site is easy. You'll create just one web site (or use the one to which wednet.edu points). Next, right-click the web site in IIS and choose Properties. On the "Web Site" tab, click "Advanced" and in the resulting dialog, use the "Add" button to add your additional domains/subdomains. That's all you'll need to do.
Hope this helps!

If you want lots of subdomain entries to map from one domain to the other then you'll need to either add A or CNAME records in the new domain pointing to the old domain.
In most cases I'd recommend a CNAME, however if you want the unadorned "myschools.org" domain to respond to HTTP requests that would have to be an A record, because you can't put in a CNAME at the top level of a zone.
Alternatively, there's a relatively new DNS record type called DNAME which can map an entire domain to another in one fell swoop. Unfortunately it's not widely supported yet.

All you should do is create two 'A' records, one of host-type '#' and the other one of host-type 'www' both should point to the IP address of your server.
It could be a bit confusing, here's an example of how to set it up #GoDaddy's:

Related

Can DNS's & CentOS handle subdomain of subdomain out of the box?

A regular subdomain is foo.website.com. Is it possible to have foo.bar.website.com? Do DNS's and/or web hosts allow this? Will Linux servers (specifically Cent OS) handle this by default or will it require bespoke configuration?
Context
We have a funny legacy setup. Our main domain for our server is foo.website.com. And url/domain pulls from the public_html folder. We now want to setup staging.foo.website.com that pulls from another folder staging.foo.website.com in the users home directory.
Since your question is so generic, my answer has to be as well.
Ahem, It's all in how the lookups are handled by your webserver!
1) DNS has no trouble allowing an "A" record to resolve to foo.website.com, and another "A" record to resolve to foo.bar.website.com, or even foo.foo.website.com. I currently have a "foo.foo.com" which resolves differently than a "foo.com" will. DNS is almost never the problem. A simple test to determine the answer is:
nslookup foo.bar.website.com
and compare it to:
nslookup foo.website.com
and check the results (assuming you have two different machines answering, or two different IPs assigned to the names.) If they are the same, on purpose, then DNS doesn't factor into the equation.
2) No, it won't come that way out of the box. They rarely have things preconfigured for domain names. Just be sure to define "foo.bar.website.com" before "foo.website.com", and most things will test in the proper order. However, if your URL request looks like:
http://foo/
instead of:
http://foo.bar.website.com/
Then you'd better hope the web server knows which FOO you are talking about, and it picks the right one every time.
3) This is one of many reasons why ReWriteModules are so very important and useful. Syntactically, the rules should state the fully qualified domain name, so that there aren't any misinterpretations. Tools like Concrete5 would expect fully unique foo.bar.website.com.conf files, just to manage such things.
Please review your web hosting service documentation, and the existing configuration. Save a copy of the httpd.conf (just not in same directory please, as some web services consider it "another service to be run!") and make a simple edit, then restart and see where it takes you. Put the originals back when you are done.

Put a subfolder onto a different server with CNAME

Here's the situation. Website.com is an ASP site which needs a blog that is to be Wordpress. So the website.com/blog needs to be hosted onto a php-friendly server. The company hosting the ASP site doesn't want to have anything to do with Wordpress so we have to use some of the shared hosting providers.
How do I have the Blog section placed onto an entirely different server? I've heard this is done with CNAME, but I've never used it. Most of the research I've done revolves around subdomains, but I need a subfolder mapping, and there's not much to read about putting subfolders onto different servers with a different IP and everything.
Thanks.
There are a few different options:
you can bring the traffic to your own server and then redirect to
the correct location
you can bring the traffic to your own server and then proxy it to the correct location
you can direct the traffic to the correct location either via full page or an IFRAME type mechanism
Each option has some benefits and drawbacks depending your devs knowledge level and your infrastructure. Regarding subdomains, you could use a combination approach where you, for example, use subdomain.yourdomain.com to point to a server instance (can be the same server or a totally different one) that maps the subdomain.yourdomain.com name to a specific path, usually via Host header.
A CNAME is a function in DNS that says "Whatever thing you wanted to find for this name, use the same thing for that other name instead". When you're working with web stuff the "thing" in there is nearly always an IP address.
That is, what a CNAME can do for you is to say that when a user's web browser tries to look up the IP address for website.com, it will use the IP address for someotherwebsite.com. Note the total absence of anything web-related, like subfolders, in this. CNAMEs work on whole domain names, nothing else. Since you want to serve only a part of the stuff at a particular name from another server, CNAME cannot help you. CNAME is the wrong tool for you problem. Do not taunt happy fun CNAME.
In order to serve website.com/blog from another server than website.com, you pretty much have to do some sort of reverse proxying (where the ASP site's server relays requests between the user and the Wordpress server). It's probably easier and more robust to give the Wordpress site its own name (blog.website.com or something), and redirect to that from website.com/blog, but only you can know if that's politically possible in your case.

Is there a way to find all existing subdomains of one main 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.

DNS question nearlyfreespeech with heroku

So I'm trying to use a domain I registered at Nearlyfreespeech(NFS) to use it with heroku. How do I do that? I am new to this, but the NFS help seems to be full of jargon and confusion, and heroku is posting email setting up video on the domain help page. Your human language input will be deeply appreciated!
Two parts to this, you'll need to add the custom domain addon to your Heroku application with the domain you intend the application to be available on, eg. www.myapp.com
Then (I've not used NFS) but you probably need to head towards something like Advanced DNS in your NFS control panel - you're looking for the ability to edit DNS records for your domain. You'll probably find a www. entry already exists - it would usually show the 'type' of record it is, if it's a series of numbers separated by dots then it's called an A record. If it is numbers with dots then you need to delete that entry and then add a new entry of type CNAME and set the host to www and the value to proxy.heroku.com. If it's already a CNAME type then you can just edit the value to be proxy.heroku.com
Hopefully that will get you going in the right direction.

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