homepage Welcome to WebmasterWorld Guest from
register, free tools, login, search, pro membership, help, library, announcements, recent posts, open posts,
Become a Pro Member
Home / Forums Index / Hardware and OS Related Technologies / Website Technology Issues
Forum Library, Charter, Moderators: phranque

Website Technology Issues Forum

DNS record settings...
What's the norm?

 2:36 pm on Mar 12, 2001 (gmt 0)

If I own domain.com, what should my DNS hosts entry do from the following:

1) Point *.domain.com to my server
2) Point only listed entires such as www.domain.com at my server.

I'm asking because I'm trying to get some sub-domains set up eg. sub1.domain.com, sub2.domain.com

However, when sub1.domain.com is resolved, it gets as far as the DNS host and then stops as there is no entry.

Should this happen?

Is there a way to get *.domain.com to point to my server or do I have to ask for an entry for each of the sub domains?

Once at the server, the sub domains can be distinguished, I just need to get them to the server...



 1:24 am on Mar 13, 2001 (gmt 0)

Ask your host if they will set up a DNS wildcard entry for you, once they do that, then you can use subdomains at will and they will resolve.


 9:15 am on Mar 13, 2001 (gmt 0)

So wildcards are possible? My host has told me that individual entries for each sub domain are needed...


 10:35 am on Mar 13, 2001 (gmt 0)

Some net appliances (eg: raq) will not allow wildcards without special adjustments. Most often, hosts are not willing to do that tweaking or they don't know how (bind is not the easiest app to work with).


 10:42 pm on Mar 13, 2001 (gmt 0)

Is it technically possible to mix named and wildcard subdomains? eg www.domain and *.domain resolve to one IP, mail.domain to another and secure.domain to a different one?


 10:28 pm on Mar 14, 2001 (gmt 0)


*.domain.com allows unlimited sub domains but they will all resolve to the root directory of the main domain. For sub-domains to resolve to different directories individual entries would be required.


> eg www.domain and *.domain resolve to one IP,
> mail.domain to another and secure.domain to a different one

IMHO it is not possible to mix *.domain.com and mail.domain or any other sub.domain using named or IP based VirtualHosts. I did some experimenting and could not get sub.domain to resolve to a separate directory one my Linux/Apache dedicated server.

If secure.domain is meant to be an SSL sub-domain it would work because SSL normally has separate VirtualHost entries and a different port, usually 443.


Example entries in zone file for using *.domain.com

www IN A
ftp IN A
mail IN A
* IN CNAME domain.com.

*.domain.com also needs to be added to the VirtualHost directive in httpd.conf to work. For example

ServerName domain.com
ServerAlias *.domain.com
DocumentRoot /home/example/htdocs


Example zone file entries using separate sub domains

www IN A
ftp IN A
mail IN A
; Sub domain entries
sub1 IN A
sub2 IN A

Separate VirtualHost entries are required in httpd.conf for each sub domain as shown in examples below.

ServerName sub1.domain.com
DocumentRoot /home/example/sub1

ServerName sub2.domain.com
DocumentRoot /home/example/sub2


 11:15 pm on Mar 14, 2001 (gmt 0)

Gorofu, if you've only got one domain on your server you can simulate a mix of named subdomains and a wildcard by using the fact that if Apache cant work out which virtual server it's being asked for it'll default to the first in the list. For example, in your conf file:


ServerName www.domain.net
DocumentRoot /home/www

ServerName sub1.domain.net
DocumentRoot /home/www/sub1

Requests to sub1 would go to /home/www/sub1, requests for www or sub2 (or whatever) would go to /home/www

I've not found a way to get this working with multiple domains - like you say, I'm not sure it's possible.

What I was wondering was, can you have a mix of named and wildcard subdomains on the DNS server? My mail server is on x.x.x.203, my webserver on x.x.x.201

Can it be set so that mail.domain resolves to 203 but anything else goes to 201?


 1:01 am on Mar 15, 2001 (gmt 0)

Should work as long as the MX record in DNS points to .203 for mail.


 4:20 am on Mar 16, 2001 (gmt 0)


After a little bit more experimenting I figured out how to use named and wildcard sub-domains for any domain hosted on an Apache Server.

The solution is to use named virtual hosts and put every named.domain.com above domain.com in httpd.conf

Also make sure the wildcard is the last entry in the domain zone file.

When a request is received, Apache finds the named sub.domain before reaching the wildcard and resolves to the correct directory. It even works on a shared IP without problems.

Example of zone file entries

IN MX 10 mail
www IN A x.x.x.201
ftp IN A x.x.x.201
mail IN A x.x.x.203
; Additional sub domains
sub1 IN A x.x.x.201
sub2 IN A x.x.x.201
; When adding sub domains make sure the * is the last line
* IN CNAME domain.com.
; Note the dot after domain.com is required

Make sure all the named sub domain VirtualHosts appear above the wildcard VirtualHost

Virtual host entries in httpd.conf
NamedVirtualHost x.x.x.201
# NamedVirtualHost x.x.x.203
# Uncomment above line to use x.x.x.203 for named virtual hosts.

<VirtualHost sub1.domain.com>
ServerName sub1.domain.com
DocumentRoot /path/to/sub1

<VirtualHost sub2.domain.com>
ServerName sub2.domain.com
DocumentRoot /path/to/sub2

<VirtualHost domain.com>
ServerName domain.com
ServerAlias *.domain.com
DocumentRoot /path/to/html


 11:52 pm on Mar 27, 2002 (gmt 0)

Hi i read your post but work only
domain.com do not work, can you tell me why?

Global Options:
 top home search open messages active posts  

Home / Forums Index / Hardware and OS Related Technologies / Website Technology Issues
rss feed

All trademarks and copyrights held by respective owners. Member comments are owned by the poster.
Home ¦ Free Tools ¦ Terms of Service ¦ Privacy Policy ¦ Report Problem ¦ About ¦ Library ¦ Newsletter
WebmasterWorld is a Developer Shed Community owned by Jim Boykin.
© Webmaster World 1996-2014 all rights reserved