Hi Jing,
Don't know if this will help you or not, but I recently wrote a update-ddns program, that by default updates one or more zoneedit DDNS records, but is generalized that you can use it with any DDNS provider. You can specify multiple ways to get your IP - several are supplied to you.
For eg: the default config file provides 4 methods that the program will try before giving up:
Code:
get-ip-number:
methods (array) = curl -s icanhazip.com, \
curl -s ifconfig.me, \
curl -s 'https://api.ipify.org', \
curl -s 'http://checkip.dyndns.org' | \
sed 's/.*Current IP Address: \([0-9\.]*\).*/\1/g'
If you're interested, you can find it under rjwhite under Github:
update-ddns
It does require 2 other modules, also under my Github - one for handling human-readable config files and the other for handling stdout/stderr and providing timeouts for hung processes. There is a man-page and perldoc for the program.
I'm not a zoneedit staff, I'm just a customer.
cheers -rj