Welcome to WebmasterWorld Guest from 54.167.110.211

Forum Moderators: phranque

Message Too Old, No Replies

DNS record settings...

What's the norm?

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

Full Member

10+ Year Member

joined:Aug 21, 2000
posts:273
votes: 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...

Air

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

Senior Member

WebmasterWorld Senior Member 10+ Year Member

joined:Feb 10, 2000
posts:1253
votes: 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)

Full Member

10+ Year Member

joined:Aug 21, 2000
posts:273
votes: 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)

Administrator from US 

WebmasterWorld Administrator brett_tabke is a WebmasterWorld Top Contributor of All Time 10+ Year Member Top Contributors Of The Month

joined:Sept 21, 1999
posts:38057
votes: 12


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)

Senior Member

WebmasterWorld Senior Member 10+ Year Member

joined:July 6, 2000
posts:904
votes: 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)

Junior Member

10+ Year Member

joined:Sept 16, 2000
posts:122
votes: 0


rpking,

*.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.

Sugarkane,

> 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 22.22.22.199
ftp IN A 22.22.22.199
mail IN A 22.22.22.199
* IN CNAME domain.com.

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

<VirtualHost 22.22.22.199>
ServerName domain.com
ServerAlias *.domain.com
DocumentRoot /home/example/htdocs
..
..
</VirtualHost>

------------------------

Example zone file entries using separate sub domains

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

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

<VirtualHost 22.22.22.199>
ServerName sub1.domain.com
DocumentRoot /home/example/sub1
..
..
</VirtualHost>

<VirtualHost 22.22.22.250>
ServerName sub2.domain.com
DocumentRoot /home/example/sub2
..
..
</VirtualHost>

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

Senior Member

WebmasterWorld Senior Member 10+ Year Member

joined:July 6, 2000
posts:904
votes: 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:

NameVirtualHost 192.168.100.1

<VirtualHost 192.168.100.1>
ServerName www.domain.net
DocumentRoot /home/www
</VirtualHost>

<VirtualHost 192.168.100.1>
ServerName sub1.domain.net
DocumentRoot /home/www/sub1
</VirtualHost>

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?

Air

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

Senior Member

WebmasterWorld Senior Member 10+ Year Member

joined:Feb 10, 2000
posts:1253
votes: 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)

Junior Member

10+ Year Member

joined:Sept 16, 2000
posts:122
votes: 0


Sugarkane

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>

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

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

Pich

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

Inactive Member
Account Expired

 
 


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

Join The Conversation

Moderators and Top Contributors

Hot Threads This Week

Featured Threads

Free SEO Tools

Hire Expert Members