Author | Topic: DNS Trick | |
---|---|---|
Bruce Anderson | DNS Trick on Sun, 06 Mar 2005 09:56:04 -0600 I have two WAA servers on my network: one for website development and the other for real, daily operation. I have a single static IP and I virtual host multiple websites. When I use IE on my developmen workstation to view one of my websites, I have to tell it which version I want to see: the one on my development server or the production server version. I have been doing this by setting and resetting the workstation's primary DNS address. I switch my workstation's primary DNS reference to either: my development server's DNS service, which points to itself for my websites, or to my internet provider's DNS, which directs requests for these websites back to my public IP, and then my router sends the port:80 traffic to my production server. This works, but I find myself spending a lot of time time reseting the primary DNS IP for my workstation, click, click, click, click, etc. Is there a smarter way to switch between two servers where each are hosting the same virtual directories? Thank you. Bruce Anderson | |
Bengt Ovelius | Re: DNS Trick on Mon, 07 Mar 2005 08:31:35 +0100 Bruce , I use my firewall to switch between the development computer and the real server. It is just a checkbox, to activate port 80 to any computer on the LAN Best regards Bengt Ovelius | |
Sander Elias | Re: DNS Trick on Mon, 07 Mar 2005 09:07:18 +0100 Hi Bruce, >Is there a smarter way to switch between two servers where each are hosting >the same virtual directories? Yes there is! in the windows folder is a file called host. it exact location is depending on your windows version, just do a search for it there is no extension, it is just called host. in there you can put the domain names you want to redirect. like www.mytestdomain.xxy 127.0.0.1 www.justonotherone.yyx 127.0.0.1 if you have done this, just switch out this file with the original. you can use a batch file for that. now you can switch with one click Regards Sander Elias | |
Phil Ide | Re: DNS Trick on Mon, 07 Mar 2005 10:54:04 +0000 Bruce, >>Is there a smarter way to switch between two servers where each are hosting >>the same virtual directories? > Yes there is! > in the windows folder is a file called host. it exact location is > depending on your windows version, just do a search for it > there is no extension, it is just called host. > in there you can put the domain names you want to redirect. like > > www.mytestdomain.xxy 127.0.0.1 > www.justonotherone.yyx 127.0.0.1 > > if you have done this, just switch out this file with the original. > you can use a batch file for that. > now you can switch with one click Here's my solution, because I need to do this a lot. The location on NT class machines (NT4/W2K,W2K3,XP) is: %windows%/system32/drivers/etc/hosts # 'live' site accessed through VPN, so local network address www.compucar.org.uk 192.168.111.111 # 'test' version on local machine compucar.org.uk 127.0.0.1 So, I simply remove the 'www.' at the start of the address and it goes to the test system. Within the web, all addresses (except those that point to other webs) are relative, so everything works as expected. Regards, Phil Ide *************************************** * Xbase++ FAQ, Libraries and Sources: * * goto: http://www.idep.org.uk/xbase * *************************************** Next from Intel: the Repentium. | |
Bruce Anderson | Re: DNS Trick on Mon, 07 Mar 2005 10:36:24 -0600 Bingo! I thank you, gentlemen. >>Next from Intel: the Repentium Phil, where do you get these? If they are coming from your head, bag the computer, leave the fens, move to Hollywood, and prepare to make the big money, because TV and movie producers are desparate for writers of one-liners. You are playing to too small an audience here. | |
Phil Ide | Re: DNS Trick on Tue, 08 Mar 2005 11:27:40 +0000 Bruce, > Bingo! I thank you, gentlemen. > >>>Next from Intel: the Repentium > Phil, where do you get these? If they are coming from your head, bag the > computer, leave the fens, move to Hollywood, and prepare to make the big > money, because TV and movie producers are desparate for writers of > one-liners. You are playing to too small an audience here. ROFL! I wish I could take credit. Some of them are my own, but the vast majority came from elsewhere. I've got a large fortune-cookie file which I add to on occasion when I find a decent cookie collection. My current cookie jar is about 127k in size, but I have others over 5Mb. Dave Pearson had a classic collection entitled "Things I'd Do As An Evil Overlord". This was my fvourite: If I find my beautiful consort with access to my fortress has been associating with the hero, I'll have her executed. It's regrettable, but new consorts are easier to get than new fortresses and maybe the next one will pay attention at the orientation meeting. Regards, Phil Ide *************************************** * Xbase++ FAQ, Libraries and Sources: * * goto: http://www.idep.org.uk/xbase * *************************************** "Captain, I sense millions of minds focusing on my cleavage" |