?
Solved

how do you auto redirect a url using dns

Posted on 2008-11-19
16
Medium Priority
?
817 Views
Last Modified: 2013-11-19
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
0
Comment
Question by:aclv
  • 5
  • 4
  • 3
  • +1
14 Comments
 
LVL 5

Accepted Solution

by:
DanJourno earned 1000 total points
ID: 23001986
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
 

Author Comment

by:aclv
ID: 23005609
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
 
LVL 5

Expert Comment

by:DanJourno
ID: 23012030
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
Free learning courses: Active Directory Deep Dive

Get a firm grasp on your IT environment when you learn Active Directory best practices with Veeam! Watch all, or choose any amount, of this three-part webinar series to improve your skills. From the basics to virtualization and backup, we got you covered.

 
LVL 1

Expert Comment

by:pathsniffer
ID: 23017365
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
 
LVL 5

Expert Comment

by:DanJourno
ID: 23022122
pathsniffer,
That wont get redirected. That will simply give the www. domains, the same IP as the abc domain.

Dan
0
 
LVL 1

Expert Comment

by:pathsniffer
ID: 23026207
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
 
LVL 5

Expert Comment

by:DanJourno
ID: 23035533
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
 

Expert Comment

by:sravs
ID: 23351609
Aclv,  Are you looking for anything.yourdomain.com should point one website
0
 

Expert Comment

by:sravs
ID: 23351613
if yes.... which DNS server your using ?
0
 

Author Comment

by:aclv
ID: 23354196
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
 

Expert Comment

by:sravs
ID: 23354361
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
 

Expert Comment

by:sravs
ID: 23354475
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
 

Author Comment

by:aclv
ID: 23354702
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
 
LVL 5

Expert Comment

by:DanJourno
ID: 24346075
I suggest evenly splitting the points if the member doesnt respond.
0

Featured Post

Get quick recovery of individual SharePoint items

Free tool – Veeam Explorer for Microsoft SharePoint, enables fast, easy restores of SharePoint sites, documents, libraries and lists — all with no agents to manage and no additional licenses to buy.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

There’s a good reason for why it’s called a homepage – it closely resembles that of a physical house and the only real difference is that it’s online. Your website’s homepage is where people come to visit you. It’s the family room of your website wh…
Dramatic changes are revolutionizing how we build and use technology. Every company is automating, digitizing, and modernizing operations. We need a better, more connected way to work together as teams so we can harness the insights from our system…
Explain concepts important to validation of email addresses with regular expressions. Applies to most languages/tools that uses regular expressions. Consider email address RFCs: Look at HTML5 form input element (with type=email) regex pattern: T…
Any person in technology especially those working for big companies should at least know about the basics of web accessibility. Believe it or not there are even laws in place that require businesses to provide such means for the disabled and aging p…
Suggested Courses
Course of the Month17 days, 1 hour left to enroll

864 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question