Resolve to specific domain

jwnetsource

Verified User
Joined
Nov 12, 2009
Messages
59
Location
Southeast Michigan
My DNS (third-party provider) is configured to send everything for a specific domain to a single IP.

For example, everything for jwnetsource.com, including; xxx.jwnetsource.com:

Host Name ---- Record Type ----- Address
-----------------------------------------------
www --------- A --------------- 204.109.63.2
@ (none) ----- A --------------- 204.109.63.2
* (other) ----- A --------------- 204.109.63.2

So, as long as the domain is configured on the server the address resolve appropriately, i.e.; http://jwnetsource.com/ works just fine.

But, if the domain is not configured on the server, such as http://support.jwnetsource.com/ it resolves to the server main default page (follow the link) for example.

This server (FreeBSD 7.2) was setup from scratch with a DirectAdmin install, which puts things in locations that I’m not familiar.

Two questions,

  1. What files (please include path) need to be changed to change the server default page (“Apache is functioning normally”)
  2. The server hosts multiple virtual domains. With that in mind, is there a way to configure the server to resolve to a specific page based on the higher-level domain request. For example; http://support.jwnetsource.com/ (doesn’t exist) resolves to a default page at http://jwnetsource.com and a request for http://weather.nollarwind.com resolves to a specific page at http://noloarwind.com?
 
One of us is confused, Jeff. Do you mean that the domain and the subdomains are not on your server? Or just the subdomains are not on your server?

According to your example, you're pointing everything to the same IP#, which is the same server.

Jeff
 
Hi Jeff,

How was Thanksgiving?

Sorry for the confusion. When a domain, or sub-domain, is not configured on the server but the DNS points to the server IP I get the default page; which states; "Apache is functioning normally."

This make total sense, no problem here. But it doesn't provide any information for the web visitor. I would like to do one of two things:

  1. Change the default page to something that provides the visitor information (link to something useful); or
  2. -
  3. Since the server hosts multiple virtual domains provide a page that is domain specific, such as;
 
You _can_ do it, but it begins to get complex. Note that I've never done it; I'm drawing on years of systems administration experience (I've been managing webservers since 1995 when the web first went commercial), but I could have some errors. However none of them should break anything.

First; find the page that says "Apache is working normally"; you can check your apache logs to find where the page is coming from.

Then you'll have to edit the page; perhaps replace it with a redirect to a php file, since you'll have to read the headers to see what domain/subdomain your visitor is looking for. And then, display whatever you want based on which domain/subdomain the visitor is looking for.

Since DirectAdmin is doing name-based hosting, which parses headers to see which of the domains on any one IP# is being called, it's straightforward. Since I don't do heavy web-programming (I have people who do that working for me), I unfortunately don't know the details.

Jeff
 
Hi,

First; find the page that says "Apache is working normally"; you can check your apache logs to find where the page is coming from.

Did this, changed page.

Then you'll have to edit the page; perhaps replace it with a redirect to a php file......

Good suggestion. I should have thought of this.

Cheers.
 
[*]IF http://JWNetSource.com EXISTS on the server but http://support.jwnetsource.com/ DOES NOT, then when there is a request for http://support.jwnetsource.com/ and the NS sends visitors to the common IP (remember all x.jwnetsource.com resolve to the same IP) the request resolves to http://JWNetSource.com; and

This is commonly called "wildcard subdomain". There is an article in the directadmin knowledgebase that shows how to set this up:

http://help.directadmin.com/item.php?id=127
 
Back
Top