linode放php,如何使用linode实现动态DNS

echo $_SERVER['REMOTE_ADDR'];

?>

bin/sh

LINODE_API_KEY=your linode key

DOMAIN_ID=your domain id

RESOURCE_ID=your resource id

# Ask your linode what your current home/remote WAN IP is

WAN_IP=`wget -O - -q http://www.yourlinode.com/MyIP.php`

# Get your old WAN IP

OLD_WAN_IP=`cat /var/CURRENT_WAN_IP.txt`

# See if the new IP is the same as the old IP.

if [ "$WAN_IP" = "$OLD_WAN_IP" ]; then

echo "IP Unchanged"

# Don't do anything if th eIP didn't change

else

# The IP changed. Update Linode's DNS to show the new IP

echo $WAN_IP > /var/CURRENT_WAN_IP.txt

wget -qO- https://api.linode.com/?api_key="$LINODE_API_KEY"\&api_action=domain.resource.update\&DomainID="$DOMAIN_ID"\&ResourceID="$RESOURCE_ID"\&Target="$WAN_IP"

fi

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值