[DNS] 【原创】建立 在 linux 通过 dynamic dns 建立自己的个人网站。

weixin_38061618 2003-06-10 06:26:39

It is too troublesome to set up your own website ,since your ip address is dynamic.
It is a blessing that  some saviors  DO provide FREE service to  map you dnsname to
your dynamic ip address.

such as www.ods.org.
Create account.
download ODS client .
complie ODS client.
finally.
You need to build your own script to wrap it up

It can be accomplished in two ways.

(1).
#touch /etc/ppp/ip-up.local
#chmod +x ip-up.local
#vi ip-up.local
./odsclient YourName YourPassword Yourdomainname $4 &

it should work.But ip-up was not triggered in my box ,so i build the following script.
(2).
#!/bin/bash
echo $$ >; adslpid
InIp=$(ip addr sh dev ppp0 |grep inet|awk '{print $2}')
while :
do
CNT=$(netstat -in |grep ppp0 |wc -l)

if [ $CNT -ne 0 ]
then
ReIp=$(ip addr sh dev ppp0 |grep inet|awk '{print $2}')
        if [ $InIp != $ReIp ]
       then
            InIp=$(ip addr sh dev ppp0 |grep inet|awk '{print $2}')
                #echo $InIp
            ./odsclient YourName YourPassword yourdomainname $InIp &
       fi

fi
sleep 300
done

Try my website: http://fargo.daemon.sh:86.
...全文
38 回复 打赏 收藏 转发到动态 举报
写回复
用AI写文章
回复
切换为时间正序
请发表友善的回复…
发表回复

477

社区成员

发帖
与我相关
我的任务
社区描述
其他技术讨论专区
其他 技术论坛(原bbs)
社区管理员
  • 其他技术讨论专区社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧