I am a de-facto IT Dude at a small company running on a LAN governed by a machine running Windows Server 08 R2. Our web sales and logistics director has asked me if I can create something internal to our company network where if you type in 'shipping' it goes to a Google Docs form that gets submitted back to him. Now, I understand how to 'name' a host, ascribing to an IP a string you can type into the address bar of a browser; I did it for our phone system and the printer at my boss' request. But how can I extend that to also resolve to the URLs of external web pages? Is that even possible?
You could use a CNAME to resolve one name to another, but that won't get you the full URL. DNS cannot resolve to complete URLs, just to host/domain names.
In order to do what you are being asked, you will need some type of application that performs an HTTP redirect. This is essentially how URL shorteners like bit.ly and goog.le work:
- User enters in shortener.com/shipping
- shortener.com web app looks up "shipping" in its database of shortened URLs
- shorterner.com redirects the user to the appropriate full URL
My company runs its own internal URL shortening service for exactly this purpose, using a short version of our corporate domain name.
As others pointed out, a DNS record can't point to a URL. But what you can do (and what I do) is run an internal Apache server and create a virtual host on the Apache server for that name.
Say you create a DNS entry for "sales" and point that to the IP address where you run Apache.
Create a virtual host as in
<VirtualHost *:80> ServerName sales RewriteEngine on RewriteRule ^(.*)$ http://example.external.site.com/mysalesform [R,L] </virtualHost>
You cannot make a record point to an URL.
What you can do is create a
CNAME so that an internal name
example.internal resolves to another name
The record will look like this:
example.internal. CNAME example.com.
You can then type
http://example.internal/restofURI to access the external site. Note that this may cause trouble with SSL certificates due to the non matching hostname.
In the DHCP set up you can set up dns suffixes to append that will be pushed to all the clients on the network. You can also set this up manually on each box in the nic ipv4 properties. under the DHCP tab.
if you put "external.com" for example in there at the top it will try shipping.external.com first.
However, you cannot really mess with the path portion of the url that way. I'd recommend the first part and then use bookmarks.