1

I want to type "go/something" in my browser address bar, and have my browser request "http://go.mydomain.com/something". The use case is where go.mydomain.com is our internal URL shortening service, so this would in turn redirect to http://some.long.url/with/some/long/text?and=parameters

Clearly, this needs to be a little more than just DNS tomfoolery, because the request that the browser makes to the server needs to include the host header with the FQDN so the webserver knows what to return. It also needs to be configured on the network (perhaps in the DHCP settings on the router?) so all users on our network benefit from this behaviour without needing to edit their OS settings, and it needs to be OS-independent, so it works on mobiles, Macs, Windows, etc...

Obviously, unqualified domain names won't work outside our LAN, but this is OK.

  • Note that this question http://serverfault.com/questions/106529/how-to-set-up-google-shortname-service-for-my-domain-so-that-the-fqdn-isnt-nee?rq=1 is similar, but I'm not sure that it provides a workable answer... (and it's not really a question!) – Richard Russell Feb 25 '14 at 11:54
  • Do you not have a default DNS suffix set on your client machines? – Chris McKeown Feb 25 '14 at 12:05
  • No, but I set one manually on my macbook, and did some testing, and when I type "www", it DNS resolves to the correct IP for "www.mydomain.com", but doesn't set the host header, so I got the webhost's generic page... Is there a way I can set this universally on DHCP for everyone in the office, and also have it so it causes the browser to make a complete new request? – Richard Russell Feb 25 '14 at 12:07
  • I see what you mean. Is there any reason why your web server cannot have the single-label names bound to the relevant sites? You could, for example, bind the host header "www" to the same site as "www.mydomain.com" – Chris McKeown Feb 25 '14 at 12:11
  • Yes, the webserver (in this case, the one that runs the URL shorterner) is not run by us, it's a Google AppEngine service. – Richard Russell Feb 25 '14 at 13:26

2 Answers2

1

DHCP servers permit you to set both a default domain name (RFC2132, DHCP option 15) and a domain search list to clients (RFC3397, DHCP option 119).

You do not need to make any modifications to servers other than whatever is responding to DHCP requests.

quadruplebucky
  • 5,041
  • 18
  • 23
  • How do these options actually work? Does the browser get told to request the FQDN? ie User types in "go" to browser. Resolver goes to DNS, gets a failure. Resolver checks DHCP config and looks for go.mydomain.com, returns IP address. How does the browser get hold of the FQDN? – Richard Russell Feb 25 '14 at 14:09
  • The browser makes a request to the OS name resolver, which already learned (from the DHCP client that made the DHCP request) that if the does not get a FQDN it should append "mydomain.com" before querying DNS. Furthermore, if go.mydomain.com fails to resolve it might know to try (from option 119) to try go.labs.mydomain.com and then go.myotherdomain.com. The resolver doesn't do anything directly with DHCP, the DHCP client takes the lease and configures the various players (IP address to interface, NS to resolver, route to network stack, etc) – quadruplebucky Feb 25 '14 at 18:28
0

As Chris said, you will have to make the HTTP server accept the non-FQDN hostname in addition to the FQDN one.

As for DHCP, the option you want is 119, Domain Search Option: http://tools.ietf.org/search/rfc3397

Beat Bolli
  • 101
  • 1