因为使用的是动态 IP,远程访问比较麻烦,所以一般会申请一个 3322 的动态域名,然后通过更新域名对应的 IP 来实现域名访问远程主机的目的。
在 linux 下,3322 的网站提供了用 lynx 来更新 IP 的命令。但是不知从何时开始,这命令已经不好使了。输出的错误如下:
后发现原因:
用
户名和密码之间的空格是不需要的,被误导了,唉。。。
修正后,结果正常。
不过,还是看看 3322 提供的 linux 版客户端吧。
先看 binary 版本: http://www.3322.org/download/ez-ipupdate-3.0.10-linux-i386.tgz
看看 libc.so.6 的版本:
没法用了,用源码编译吧。
源码版本:http://www.3322.org/download/ez-ipupdate-3.0.10.tgz
make 的时候出错:
主要是 extern int errno; 惹的祸,patch 之。
现在 patch 完成,ez-ipupdate 可以工作了。
IP 都没改变,不用更新了。
在 linux 下,3322 的网站提供了用 lynx 来更新 IP 的命令。但是不知从何时开始,这命令已经不好使了。输出的错误如下:
- $lynx -mime_header -auth=xxxx : xxxx "http://www.3322.org/dyndns/update?system=dyndns&hostname=xxxx.3322.org"
- Can't Access `file://localhost/home/xxxx/:'
- Alert!: Unable to access document.
- lynx: Can't access startfile
- Can't Access `file://localhost/home/xxxx/:'
- Alert!: Unable to access document.
- Can't Access `file://localhost/home/xxxx/xxxx'
- Alert!: Unable to access document.
- lynx: Can't access startfile
- lynx: Username and Password required!!!
- Can't Access `file://localhost/home/xxxx/:'
- Alert!: Unable to access document.
- Can't Access `file://localhost/home/xxxx/xxxx'
- Alert!: Unable to access document.
- Looking up www.3322.org
- Making HTTP connection to www.3322.org
- Sending HTTP request.
- HTTP request sent; waiting for response.
- Alert!: Access without authorization denied -- retrying
- Retrying with access authorization information.
- Looking up www.3322.org
- Making HTTP connection to www.3322.org
- Sending HTTP request.
- HTTP request sent; waiting for response.
- Alert!: Can't retry with authorization! Contact the server's WebMaster.
- Can't Access `http://www.3322.org/dyndns/update?system=dyndns&hostname=xxxx.3322.org'
- Alert!: Unable to access document.
- lynx: Can't access startfile
修正后,结果正常。
- HTTP/1.1 200 OK
- Server: nginx
- Date: Sat, 13 Dec 2008 11:29:48 GMT
- Content-Type: text/plain; charset=GBK
- Connection: close
- good xxx.xxx.xx.xx
不过,还是看看 3322 提供的 linux 版客户端吧。
先看 binary 版本: http://www.3322.org/download/ez-ipupdate-3.0.10-linux-i386.tgz
- $ ./ez-ipupdate
- ./ez-ipupdate: relocation error: ./ez-ipupdate: symbol errno, version
- GLIBC_2.0 not defined in file libc.so.6 with link time reference
看看 libc.so.6 的版本:
- $ /lib/libc.so.6
- GNU C Library stable release version 2.7, by Roland McGrath et al.
- Copyright (C) 2007 Free Software Foundation, Inc.
- This is free software; see the source for copying conditions.
- There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A
- PARTICULAR PURPOSE.
- Compiled by GNU CC version 4.2.4 (Ubuntu 4.2.4-1ubuntu1).
- Compiled on a Linux >>2.6.24-16-server<< system on 2008-09-12.
- Available extensions:
- crypt add-on version 2.1 by Michael Glad and others
- GNU Libidn by Simon Josefsson
- Native POSIX Threads Library by Ulrich Drepper et al
- BIND-8.2.3-T5B
- For bug reporting instructions, please see:
- <http://www.gnu.org/software/libc/bugs.html>.
源码版本:http://www.3322.org/download/ez-ipupdate-3.0.10.tgz
make 的时候出错:
- gcc -g -O2 -o ez-ipupdate ez-ipupdate.o conf_file.o md5.o cache_file.o pid_file.o
- /usr/bin/ld: errno: TLS definition in /lib/libc.so.6 section .tbss mismatches non-TLS reference in conf_file.o
- /lib/libc.so.6: could not read symbols: Bad value
- collect2: ld returned 1 exit status
- make: *** [ez-ipupdate] Error 1
主要是 extern int errno; 惹的祸,patch 之。
- diff -uNr ez-ipupdate-3.0.10/conf_file.c ez-ipupdate-3.0.10_diff/conf_file.c
- --- ez-ipupdate-3.0.10/conf_file.c 2000-10-23 10:36:18.000000000 +0800
- +++ ez-ipupdate-3.0.10_diff/conf_file.c 2008-12-12 23:32:53.000000000 +0800
- @@ -36,13 +36,14 @@
- #include <string.h>
- #include <conf_file.h>
- +#include <errno.h>
- #if HAVE_STRERROR
- -extern int errno;
- +//extern int errno;
- # define error_string strerror(errno)
- #elif HAVE_SYS_ERRLIST
- extern const char *const sys_errlist[];
- -extern int errno;
- +//extern int errno;
- # define error_string (sys_errlist[errno])
- #else
- # define error_string "error message not found"
- diff -uNr ez-ipupdate-3.0.10/error.h ez-ipupdate-3.0.10_diff/error.h
- --- ez-ipupdate-3.0.10/error.h 2000-11-25 06:46:37.000000000 +0800
- +++ ez-ipupdate-3.0.10_diff/error.h 2008-12-12 23:31:59.000000000 +0800
- @@ -1,12 +1,14 @@
- #ifndef _ERROR_H
- #define _ERROR_H
- +#include <errno.h>
- +
- #if HAVE_STRERROR
- -extern int errno;
- +//extern int errno;
- # define error_string strerror(errno)
- #elif HAVE_SYS_ERRLIST
- extern const char *const sys_errlist[];
- -extern int errno;
- +//extern int errno;
- # define error_string (sys_errlist[errno])
- #else
- # define error_string "error message not found"
现在 patch 完成,ez-ipupdate 可以工作了。
- $ ./ez-ipupdate -c qdns.conf
- ez-ipupdate Version 3.0.10
- Copyright (C) 1999-2000 Angus Mackay.
- no update needed at this time