socket and DynDNS

Stephan Schulz schulz at sunbroy2.informatik.tu-muenchen.de
Wed Oct 22 10:54:31 EDT 2008


Hi all,

I need an application that will duplicate an incoming stream of UDP
messages and send it on to some external server that has a dynamic DNS
address. I can use the dynamic name someserver.dyndns.org to get the
current IP address or to send data too.

The question I have is how to do this in the most elegant way. What
happens if I just use the tuple ("someserver.dyndns.org", someport) as
the address in socket.sendto()? Will the library do the right thing
every time? I.e. will it cache the IP address long enough, but not too
long?

I'm potentially sending off thousands of messages per second - almost
certainly hundreds. Will someone in the chain do a smart enough
caching that a) a change in the IP address will be noted and b) I
don't incur a full DNS resolution overhead for each packet?

My naive and ugly alternative is to periodically (e.g. every 5
minutes) do a manual lookup and use the last address. This may, of
course lead to a service outage if the address changes, but that is
supposed to be a rare event and is deemed acceptable.

Oh yes, the OS is Red Hat EL5, if that makes a difference with respect
to the underlying name resolution.

Thanks for any input!

Bye,

    Stephan

-- 
-------------------------- It can be done! ---------------------------------
       Please email me as schulz at eprover.org (Stephan Schulz)
----------------------------------------------------------------------------



More information about the Python-list mailing list