Login    
   Windows Server to Workstation
   Convert Windows Server 2008/2008 R2/2012 to a Workstation!
    Register FAQ  •  Search    
It is currently Mon May 20, 2013 6:54 am

All times are UTC [ DST ]




Post new topic Reply to topic  [ 5 posts ] 
Author Message
 Post subject: How easy would it he to rig something like this up?
PostPosted: Mon May 19, 2008 5:56 pm 
Offline

Joined: Tue May 13, 2008 7:51 pm
Posts: 6
Alright, lemme explain the situation. At my parent's house back home, I have a web server set up linked up with DynDNS's service (automatic IP updates to domain names). So everything there works fine. I have a personal domain name that I use to easily have HTTP access to my files and such.

Now at my apartment (I'm away at college :mrgreen: ), I would like to set up a subdomain that points to my IP address here. This would be sweet because then I could remote desktop to my computer here and deal with my local files easily and such. I'm pretty sure that DynDNS's service wouldn't do the trick in this case. I was thinking that I could set up a recurring FTP transfer that would transfer a text file that contained my IP address at my apartment to my server back home.

After this point I'm lost. Is there a way to do IP address redirection in IIS from a text file? How possible is it to set something like this up? Thanks in advance! :D


 Profile  
 Post subject: Re: How easy would it he to rig something like this up?
PostPosted: Mon May 19, 2008 8:43 pm 
Offline
Win2008Workstation Admin
Win2008Workstation Admin
User avatar

Joined: Sat Mar 08, 2008 5:10 pm
Posts: 1063
Location: The Netherlands
Hello nrajlich,

A redirection from a textfile is possible via the following ASP.NET code:
Default.aspx
Code:
<%@ Page Language="C#" %>

<script runat="server">
    public void Page_Load(object sender, EventArgs e)
    {
        System.IO.StreamReader sr = new System.IO.StreamReader(@"C:\ftproot\ip.txt");
        string ip = sr.ReadLine();
        sr.Close();
       
        Response.Redirect(string.Format("http://{0}/", ip));
    }
</script>


Modify the path to your own path, put the ip address in there and place the Default.aspx file within the inetpub folder!

BTW you can also use WebDAV in IIS to access the files and folders on the server like it is a file server in the network. It will also go through the firewalls at your school network. ;)

_________________
|[ Mainboard: Gigabyte GA-M56S-S3 ]|[ CPU: AMD Athlon 64 X2 6000+ ]|[ RAM: 4096 MB (DDR2-800 SDRAM) ]|[ GPU: NVIDIA GeForce 8600 GT (256 MB) ]|[ OS: Microsoft Windows Server 2008 R2 Enterprise ]|


 Profile  
 Post subject: Re: How easy would it he to rig something like this up?
PostPosted: Mon May 19, 2008 10:26 pm 
Offline

Joined: Tue May 13, 2008 7:51 pm
Posts: 6
The script you posted would also change the address bar to the ip address. as in, when you go to subdomain.domain.com it would change to your ip address. I'm looking for a way to mask the IP address, and leave the domain name intact. Do you know of any way to do this through Server? Otherwise it would be more related to DynDNS I think.

EDIT: Here's a little Java program I wrote to make a text file containing your local IP address:

Code:
import java.io.*;
import java.net.*;

public class IPAddressWriter {
    public static void main(String[] args) {
        URL ipURL = null;
        BufferedReader in = null;

        try {
            ipURL = new URL("http://whatismyip.org/");
        } catch (MalformedURLException e) {
            e.printStackTrace();
        }

        try {
            in = new BufferedReader(new InputStreamReader(yahoo.openStream()));
            BufferedWriter out = new BufferedWriter(new FileWriter("ip.txt"));
            out.write(in.readLine());
            out.close();
            in.close();
        } catch (IOException e) {
            e.printStackTrace();
        }
    }
}


So, now I can schedule a Windows task to do an FTP transfer to my computer at home, so that leaves only one more hurdle: getting a subdomain redirected to that text file...


 Profile  
 Post subject: Re: How easy would it he to rig something like this up?
PostPosted: Tue May 20, 2008 6:44 am 
Offline
Win2008Workstation Admin
Win2008Workstation Admin
User avatar

Joined: Sat Mar 08, 2008 5:10 pm
Posts: 1063
Location: The Netherlands
Then you have to set up your server as a DNS Server by adding the serverrole DNS Server and configuring your zone like in this Windows Server 2003 DNS Server tutorial. It will be a little different from the Server 2008 wizard, but you 'll find out. Use nrajlich.dyndns.org (or whatever you have) as Zone name (step 5) and fill the ip of your other home in at step 9.

Forward port 53/udp at your servers router to allow incoming dns queries.

Never worked with DNS Servers before but I think it should work! :)

_________________
|[ Mainboard: Gigabyte GA-M56S-S3 ]|[ CPU: AMD Athlon 64 X2 6000+ ]|[ RAM: 4096 MB (DDR2-800 SDRAM) ]|[ GPU: NVIDIA GeForce 8600 GT (256 MB) ]|[ OS: Microsoft Windows Server 2008 R2 Enterprise ]|


 Profile  
 Post subject: Re: How easy would it he to rig something like this up?
PostPosted: Wed May 21, 2008 5:57 pm 
Offline

Joined: Tue May 13, 2008 7:51 pm
Posts: 6
Sweet! Thanks! I'll try to set that up this weekend when I go home. Ya I alway wondered if that DNS Server role had anything to do with it. Looks like I'm messing around with that! Thanks for the replies Arris


 Profile  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 5 posts ] 

All times are UTC [ DST ]


Who is online

Users browsing this forum: No registered users and 2 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
phpBB skin developed by: John Olson
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group
[ Time : 0.061s | 15 Queries | GZIP : Off ]