how do you auto redirect a url using dns

i have a small issue at our office, we set up domain names in our dns eg. xxx.abc.com or def.acb.com or lkjh.abc.com and they all work fine. however some of our sales staff are giving out www.xxx.abc.com 
www.def.abc.com etc etc (they are putting in a www thus adding a 4th level)

i am trying to find out how just using DNS we can force the site to drop the www portion

the site is hosted on IIS6.0 on a win 2k 2003 box
aclvAsked:
Who is Participating?
 
DanJournoConnect With a Mentor Commented:
Theres no way to do this via DNS alone.

If you point www.xyz.abc.com to a webserver, you could use an ASP script to redirect the user to the correct site.
Either this code or the code below the dashes should redirect if you put it into an asp script.
<%
response.redirect("http://" & mid(Request.ServerVariables("HTTP_HOST"),instr(Request.ServerVariables("HTTP_HOST"),".")))
%>
---------------------------
<%
response.redirect("http://" & mid(Request.ServerVariables("HTTP_HOST"),instr(Request.ServerVariables("HTTP_HOST"),".")+1))
%>

Sorry this wasnt the answer you were looking for.

Dan
0
 
aclvAuthor Commented:
will that code strip away the www portion. the issue is we have one large site. with several abc.domain.com
def.domain.com
ghi.domain.com

all point to one website/

and some users are like i said putting in www. infront of it.  


so its one
0
 
DanJournoCommented:
That code should strip out the www and forward the user to the address they really wanted to go to.

If it doesnt, let me know what happens and i'll adjust the code.

Take care
Dan
0
Introducing Cloud Class® training courses

Tech changes fast. You can learn faster. That’s why we’re bringing professional training courses to Experts Exchange. With a subscription, you can access all the Cloud Class® courses to expand your education, prep for certifications, and get top-notch instructions.

 
pathsnifferCommented:
You could use DNS entries to get the desired result.

Just create Pointer Records in your DNS zone data

Create a Alian (CNAME) in your DNS server with asterik (*). e.g. *.xxx.abc.com -> xxx.abc.com.
This way when you type www.xxx.abc.com it will automatically redirected to xxx.abc.com.
i.e. www.xxx.abc.com -> xxx.abc.com
0
 
DanJournoCommented:
pathsniffer,
That wont get redirected. That will simply give the www. domains, the same IP as the abc domain.

Dan
0
 
pathsnifferCommented:
Dan,
I agree it will evaluate to the same IP but it will also cause the web browser to redirect its request to that IP. hence the www.xxx.abc.com request will go to xxx.abc.com.

I have done it and it work and Microsoft in it SBS 2003 server uses the same concept to redirect the domain users to Sharepoint portal server "companyweb".

aclv,
The only thing you might have to do it you have hosted all the domain/sub domains on the same server is to make Host Header entries in IIS.
0
 
DanJournoCommented:
Pathsniffer,

Although i agree that your solution will work, it does not match up with ACLV's request.
He wanted the www to be stripped out.

Dan
0
 
sravsCommented:
Aclv,  Are you looking for anything.yourdomain.com should point one website
0
 
sravsCommented:
if yes.... which DNS server your using ?
0
 
aclvAuthor Commented:
sravs,  yes they all point ot one website , the issue is that some people put in the www.sub.yourdomain.com and then the ssl says its not valid.  as the ssl is for *.yourdomain.com
we are using godaddys dns manager so i am not sure what the dns is running on.
0
 
sravsCommented:
not sure what kind of options godaddy gives.

but if you check below. 4th level of subdomain also can point to the same website.
http://www.xyz.bloodsavelives.org/
http://xyz.bloodsavelives.org/
0
 
sravsCommented:
Check if your Hosting provider can allow you add entry like below thru DNS Management

*.def.acb.com

It worked for me on Tiny dns.


0
 
aclvAuthor Commented:
all our web domains point to the same site now, the issue is having it strip out the www
so when you type in say "http://www.xyz.bloodsavelives.org/" it would just redirect to: http://xyz.bloodsaveslives.org  
 
 
0
 
DanJournoCommented:
I suggest evenly splitting the points if the member doesnt respond.
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.