DNS Problems
Author
Discussion

WTD

Original Poster:

818 posts

265 months

Tuesday 30th October 2007
quotequote all
Hey guys, am having trouble setting up my server with domains and subdomains, if anyone can help I'll be very grateful!

What I have.
I have a server.
I have a domain name.
I have a DNS server, and the associated Nameserver.

What I am trying to achieve.
I have set up 4 subdomains as virtual servers, www, jp, en and blog on my apache, using httpd -S i get the output

VirtualHost configuration:
wildcard NameVirtualHosts and _default_ servers:
_default_:443 Server31.Register1.net (/etc/httpd/conf.d/ssl.conf:81)
  • :* www.akachanwear.com (/etc/httpd/conf/httpd.conf:992)
  • :* en.akachanwear.com (/etc/httpd/conf/httpd.conf:998)
  • :* jp.akachanwear.com (/etc/httpd/conf/httpd.conf:1005)
  • :* blog.akachanwear.com (/etc/httpd/conf/httpd.conf:1011)
In my DNS management screen, I have added 4 'A or CNAME' records, with prefix matching the www, en, jp and blog, domain as above and IP address as one of my external IP addresses.

What happens, and Why?
I have created a test index.html file in each of the appropriate virtual servers own root folder saying 'blog root' or 'en root' so I can debug whats going on... BUT
here is the confusing part.

www.akachanwear.com correctly opens up the main www root index.html file

blog.akachanwear.com incorrectly opens up the main www root index.html file

en.akachanwear.com incorrectly opens up the main www root index.html file

jp.akachanwear.com fails to open any page?

Any Guru's around can lend me their brains??


Edited by WTD on Tuesday 30th October 09:17

matt173407

515 posts

261 months

Tuesday 30th October 2007
quotequote all
if you ping the name is it resolving to the correct ipaddress, it may not be dns thats wrong

WTD

Original Poster:

818 posts

265 months

Tuesday 30th October 2007
quotequote all
They all resolve to the same IP address, as I expected them too..

So i guess this means its a problem with my virtual server setup.!

cottonfoo

6,053 posts

242 months

Tuesday 30th October 2007
quotequote all
Can you post the Apache config?

WTD

Original Poster:

818 posts

265 months

Tuesday 30th October 2007
quotequote all
my virtual servers is this here:


<VirtualHost *:80>
ServerAdmin server@akachanwear.com
ServerName www.akachanwear.com
DocumentRoot /var/www/html/
</VirtualHost>

<VirtualHost *:80>
ServerAdmin server@akachanwear.com
ServerName en.akachanwear.com
DocumentRoot /var/www/html/en/
</VirtualHost>


<VirtualHost *:80>
ServerAdmin server@akachanwear.com
ServerName jp.akachanwear.com
DocumentRoot /var/www/html/jp/
</VirtualHost>

<VirtualHost *:80>
ServerName blog.akachanwear.com
DocumentRoot /var/www/html/blog/
</VirtualHost>

WTD

Original Poster:

818 posts

265 months

Tuesday 30th October 2007
quotequote all
..

Edited by WTD on Tuesday 30th October 12:05

cottonfoo

6,053 posts

242 months

Tuesday 30th October 2007
quotequote all
What's the value of the UseCanonicalName setting?

Ok it's Off which is correct, uncomment the NameVirtualHost directive and reload.

Edited by cottonfoo on Tuesday 30th October 12:02

WTD

Original Poster:

818 posts

265 months

Tuesday 30th October 2007
quotequote all
have tried both on and off

WTD

Original Poster:

818 posts

265 months

Tuesday 30th October 2007
quotequote all
simple as that!

thanks very much for your help, really appreciate it :-)

JamieBeeston

9,294 posts

297 months

Tuesday 30th October 2007
quotequote all
You will probably also want an A record for akachanwear.com (blank in the first box)

assuming you want http://akachanwear.com to work smile

J

cottonfoo

6,053 posts

242 months

Tuesday 30th October 2007
quotequote all
You are better off with CNAMEs pointing to the main server A record if you plan on hosting them all on the same box for a while, less DNS admin.

JamieBeeston

9,294 posts

297 months

Tuesday 30th October 2007
quotequote all
Makes no real difference in the real world

You still need to add each record, and one typo with cnames leads to everything going down, as opposed to just the one record.

cottonfoo

6,053 posts

242 months

Tuesday 30th October 2007
quotequote all
JamieBeeston said:
Makes no real difference in the real world
It makes a massive difference. There's the right way, and the shit to maintain way.

JamieBeeston said:
You still need to add each record, and one typo with cnames leads to everything going down, as opposed to just the one record.
You're adding records that are effectively the same apart from the CNAME. If you break that you shouldn't be playing with DNS. You have to add each record regardless. If primary server's IP address changes you then have to change every other A record, whereas a CNAME is automatic - one change versus all the CNAMES. Makes much more sense, and why CNAME is there.

JamieBeeston

9,294 posts

297 months

Tuesday 30th October 2007
quotequote all
cottonfoo said:
JamieBeeston said:
Makes no real difference in the real world
It makes a massive difference. There's the right way, and the shit to maintain way.

JamieBeeston said:
You still need to add each record, and one typo with cnames leads to everything going down, as opposed to just the one record.
You're adding records that are effectively the same apart from the CNAME. If you break that you shouldn't be playing with DNS. You have to add each record regardless. If primary server's IP address changes you then have to change every other A record, whereas a CNAME is automatic - one change versus all the CNAMES. Makes much more sense, and why CNAME is there.
You think DNS is used by geeks in a lab somewhere and noone else?

This is the world of Web based control panels, and DNS control for home users.

RFC's may well say use CNAMEs, but in the real world it makes not a jot.

A records are quicker than CNAMES, and allow crucially allow you to point to different IPS for different hosts.

You're supposed to cross the road only at a marked crossing, doesn't mean that's how it happens does it?

You're making a mountain out of a molehill..

But, as all good vendors should, we provide the client with the option to use CNAME or A records.

J

cottonfoo

6,053 posts

242 months

Tuesday 30th October 2007
quotequote all
Well, from that perspective it's fine and you're right, but quite different from where I'm coming from.

JamieBeeston

9,294 posts

297 months

Tuesday 30th October 2007
quotequote all
cottonfoo said:
Well, from that perspective it's fine and you're right, but quite different from where I'm coming from.
smile like I said, there's RFC's, then there's the real world.

You're of course correct in theory..

But theory rarely makes it out of the lab wink

J

cottonfoo

6,053 posts

242 months

Tuesday 30th October 2007
quotequote all
I still do things that way in business, but you've already mitigated the administration overhead by having all your records in a database with code to deal with those kinds of changes so it just makes sense to keep it simple. You also then don't have to worry about someone assigning a CNAME to the NS or MX records smile