General Networking/Lan/Wan/Question about DNS (or maybe not)

Advertisement


Question
Hi Justin,

I'm a web developer on a software house, which develops websites for clients. The websites are hosted by third party, so we don't have full control over it.

One of our clients one day asks us, why they can access their website if they write to the address, say: "www.example.com/", but they can't connect if the address is, say: "example.com/" ? They need that the website can be accessed normally with or without the www. When accessed without the www, it's not returning 404 server not found. The browser CAN find the server of the website, but instead returning the website's own 404 resource not found error page. That means the url without www is pointing to a nonexistent resource within the website, but the website itself is found. I still can't understand why "www.example.com/" point to different resources than "example.com/".

The server is using apache-tomcat, and the web pages are served using servlet and Enfinity framework.

I initially suspect this has something to do with DNS. But now I'm not sure so much. Can you point me to the direction of which may go wrong? Thank you very much.

Answer
Hello!

It most certainly sounds like it is very likely a DNS configuration issue. It could also be a problem with the configuration of the virtual hosts file in Apache, but that is only usually the case if multiple web sites with different domain names are running on one server.

Technically www.example.com and example.com are two different things according to DNS, so it is not automatically the same thing, it has to be set up that way. The www. is what is called an "A" record in DNS, and it is probably pointing to the wrong IP.

To verify it is DNS, you can use the nslookup command in the command prompt of windows (I'm not sure the Linux equivalent). It would be written as "nslookup example.com" and "nslookup www.example.com" which will tell you the IP address it will resolve to. You can also use www.mxtoolbox.com to look up the A record.

If it is a virtualhosts problem, I haven't done that in quite some time as I've focused more on Microsoft products, but this may help you to start out - http://httpd.apache.org/docs/2.2/vhosts/examples.html

Since it is hosted elsewhere, it is very likely the provider would need to do this for you if they haven't already.

Let me know if you have any other questions or if anything didn't make sense in my answer.  

General Networking/Lan/Wan

All Answers


Answers by Expert:


Ask Experts

Volunteer


Justin W.

Expertise

I can answer questions on DHCP, security, DNS, IPv4, Sub-netting/VLANS, and more.

Experience

I have been working in IT for almost 10 years, all years spent in some sort of support role, but the past two years I've been in an IT Administration position, overseeing Windows Servers, VMware vSphere running on a Cisco UCS platform with Cisco networking devices

Education/Credentials
I have a BAS with dual-major from Davenport University, in Grand Rapids, MI. My majors were Computer Networking and Network Security.

Awards and Honors
I am Network+ certified.

©2016 About.com. All rights reserved.