Add update_dyndns function.

Move dns update code out of main() to a separate function.