HodgeHi Posted June 16, 2008 Posted June 16, 2008 A guy came in to install and configure our library software and as part of the configuration he set up a dns entry for the domain name to go the the webserver but also on a specific port number. I think he did this as part of the DNS entry on our Server 2003 box. Unfortunately i was called to turn a plug on or something at the time (which was apparently really urgent) and so missed what he actually did. Am i right that this can be done at the DNS console or am i being stoopid. I tried looking for a DNS record that maybe did what i thought i needed but it failed miserably. I think i tried the SRV record.
Geoff Posted June 16, 2008 Posted June 16, 2008 It's not possible to do this in a DNS entry. DNS entries simply resolve hostnames to ip addresses. Might of been in the shortcut though?
HodgeHi Posted June 16, 2008 Author Posted June 16, 2008 I think he used internet Explorer typed in the servers address and it resolved to the port number automatically IIRC. I just wished the i saw what he did. Thanks anyway.
kmount Posted June 16, 2008 Posted June 16, 2008 Sounds like a redirect. IE, if he used Internet Explorer without specifying a port, it will connect to port 80, so if there was something on port 80 that said "actually mate, you want to be on port 6345" it could redirect it for you almost transparently. That's what I'd guess he's done.
localzuk Posted June 16, 2008 Posted June 16, 2008 It isn't possible to do this with the DNS system as it is not part of the spec. It would require some form of reverse proxy/redirect to do it at either the web server level or on a proxy server.
Slartibartfast Posted June 16, 2008 Posted June 16, 2008 SRV records can do this. See SRV record - Wikipedia, the free encyclopedia
m2d2 Posted June 16, 2008 Posted June 16, 2008 Won't the port number just be hard coded in the client application or HTML code (if web based)?
localzuk Posted June 16, 2008 Posted June 16, 2008 SRV records can do this. See SRV record - Wikipedia, the free encyclopedia Hmm... that'll teach me to not read up on SRV records!
SimAda00 Posted June 16, 2008 Posted June 16, 2008 Annother approach if using IIS on windows server is called hostheaders. As you can only have one website running on one port, you can use hostheaders to run the website on the same port, but alter the address used to access the site. (not sure if that makes sense, example below) Basically if i have a server and its FQDN is server.mynetwork.com. DNS record is server.mynetwork.com = 192.168.1.1 server is hosting 2 websites. Website 1 runs on port 80 and website 2 runs on port 8080. So accessing mynetwork.com would return website 1, and accessing mynetwork.com would return website 2. In IIS you could alter website 2, so that it runs on port 80, but can only be accessed when requested from mynetwork.com. Aslong as their is a DNS entry either A or CNAME for site2.mynetwork.com pointing to server To do this open inetmgr, under websites right click one and select properties. On the 'Web site' tab, click advanced Click Add in that window you can specifiy an IP address that it will use to listen on, the port it will listen on, and the hostheader where you put what domain name or address will get this site. In the case of my example for site2 it will be IP = (All Unassigned) and port = 80, Hostheader = site2.mydomain.com. (It can be done for ssl aswell) Not sure if thats what has been done, but as you mentioned it seemed like he did it through dns, the only other thing i can think of is again srv records, but browsers dont use them 1
Slartibartfast Posted June 19, 2008 Posted June 19, 2008 web browsers don't use SRV records. D'oh! Annother approach if using IIS on windows server is called hostheaders. As you can only have one website running on one port, you can use hostheaders to run the website on the same port, but alter the address used to access the site. (not sure if that makes sense, example below) Virtual Hosts on Apache serve a similar purpose. (It can be done for ssl aswell) I don't think that's possible under IIS.
HodgeHi Posted June 19, 2008 Author Posted June 19, 2008 The software runs its own web server which is a jetty web server hence the port 2000 usage. I tried to get apache to forward request for a domain name onto port 2000 but it failed as i assume it would look for the port number itself. A long shot and missed by a mile. I have just re-read the srv description and for the life of me do not know why i thought it would work. But when you try to create an SRV record you get the option to choose the type of service the protocol for the service and the port the service uses. I thought that this would work because of this. oh well... I'll Keep trying :-)
SYNACK Posted June 19, 2008 Posted June 19, 2008 (edited) The software runs its own web server which is a jetty web server hence the port 2000 usage. I tried to get apache to forward request for a domain name onto port 2000 but it failed as i assume it would look for the port number itself. A long shot and missed by a mile. Is this Access-It? With ours we just added a desktop icon to: "%programfiles%\Internet Explorer\iexplore.exe" http://libserver:2000 and push it as an IE favorite in group policy which does the trick nicely. You could also change the port number in the jetty configure file to make it use port 80. If you have ISA you could use a publishing wizard to redirect the traffic or you could use Apache in reverse proxy mode. Personally if I have a requirement for it to be under port 80 I would just change the config to make it listen on port 80. If it is Access-It it should support this and will not mess with the core application because it accesses the DB directly. Edited June 19, 2008 by SYNACK 1
SYNACK Posted June 19, 2008 Posted June 19, 2008 The config xml for it is located here: %programfiles%\Access-It Software\Access-It Library\jetty\brooklyn.xml 1
HodgeHi Posted June 19, 2008 Author Posted June 19, 2008 It is indeed access-it. The issue isn't so important at the moment but we may move the service over to an external connecting server. With a library.school.sch.uk domain name for users to connect could we get the public facing router to re-route the traffic from that domain name to port 2000. I think this would be the best solution if possible.
SYNACK Posted June 19, 2008 Posted June 19, 2008 (edited) It is indeed access-it. The issue isn't so important at the moment but we may move the service over to an external connecting server. With a library.school.sch.uk domain name for users to connect could we get the public facing router to re-route the traffic from that domain name to port 2000. I think this would be the best solution if possible. Depends on your router, very few can distinguish between subdomains in inbound traffic as all inbound requests look the same to it. Meaning you can only have one site per ip without extra software. If you have multiple external ip addresses and the subdomain can be pointed to one of those that is not in use for a web server the router can use this to distinguish between the traffic. With only a single external IP using subdomains to direct the traffic would require you to setup ISA (if you have it) to redirect traffic or use an apache server that could reverse proxy to the different sites that are running under different domain/subdomains. You would need to do this anyway it you only have a single external ip and your router is not layer 4 capable. Edited June 19, 2008 by SYNACK Clarity
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now