I'm using windows server 2008, and one of the things I need to do in order to pair to a domain name is send a file with the computers current IP address (it's not static) to a server via sftp every few minutes. The problem is that I'm not sure how to do this.
Asked
Active
Viewed 874 times
0
-
1Whats digesting the file? There has to be a more streamlined way then secure transferring a file thats wrapped in a protocol, that in itself, has the data you want. – tMC Jun 01 '11 at 22:58
-
I would love to hear that there is, but I can't think of any way. – Sam Jun 01 '11 at 23:00
-
I'd just listen on an obscure UDP socket for inbound datagrams. The payload can be the hostname; the IP address can be obtained from the header. If security is an issue, just sign the payload- encryption is of no use as the info you want (the ip) is in the IP header anyway. http://www.java2s.com/Code/Python/Network/UDPExample.htm – tMC Jun 01 '11 at 23:07
-
I'm not quite sure how to change that script to do what I want, when I enter the host name (x.com), it says " 'x' is not defined ". Also, wouldn't that be my internal IP? – Sam Jun 01 '11 at 23:18
-
2Hostnames are strings so they need to be wrapped in quotes 'x.com'. If you've never used Python before, it would do you well learn the language before trying to build a network tool. http://www.diveintopython.org/ – tMC Jun 01 '11 at 23:26
-
Any reason you aren't using one of the many Dynamic DNS services available? – nobody Jun 01 '11 at 23:34
-
Andrew you're right! Thank you for reminding me! – Sam Jun 02 '11 at 01:07
1 Answers
0
I would send it via XMPP. You can set up a listener service for the server.
Send an xmpp message using a python library
Here are some ideas on XMPP servers to run on your IIS server (listening to recieve the incoming messages from clients http://metajack.im/2008/08/26/choosing-an-xmpp-server/
Pretzel looks nice
this python code can be run client side to get the public IP address.
host, aliaslist, lan_ip = socket.gethostbyname_ex(socket.gethostname())
print host
print aliaslist
print lan_ip[0]
Than you would send via XMPP message containing the IP to the server you have set up on your IIS server. Depending on what you want to do with the IP address once it gets to the server, you will handle the message serverside

Community
- 1
- 1

Hortinstein
- 2,667
- 1
- 22
- 22
-
So now I understand how sending it would work, but would you elaborate on listeners? I'm not quite sure how to use those to get the IP address. – Sam Jun 01 '11 at 23:53