Total Pageviews

Showing posts with label ddns. Show all posts
Showing posts with label ddns. Show all posts

Tuesday, 13 January 2026

volaryddns.net的免费二级域名支持ddns动态域名解析



免费开通volaryddns属于你自己的个性化子域名(形如:xyz.volaryddns.net),无广告或使用次数限制。IP 变更将在 10 分钟内全球传播,确保您的服务始终可访问。无隐藏费用、广告、使用限制或额度限制。长期免费使用,不用续期。

注册免费账户

注册volaryddns简单只需邮箱和密码,无需手机号、信用卡。

网址:https://volaryddns.net/

注册的时候同时把域名名称选好。

验证一下邮箱便可注册成功。
解析域名

volaryddns免费域名可以进行动态解析,随着设备的ip变化而变化,也可以解析到固定不变的ip用于建站。
动态解析

登录之后看到官方自带两种动态解析的脚本,可在类 Unix 系统上设置 DDNS,也可在 Windows 和非 Unix 系统上设置 DDNS(需安装 Python 和 pip)。
设置动态解析

解析到虚拟主机

如果想解析到虚拟主机,而又不想用上面的方法,我们还可以用PHP脚本来设置A记录。


演示域名绑定在beget俄罗斯免费虚拟主机,有需要的童鞋可以去看看还能不能注册。

在支持php的主机,创建一个网页文件,代码如下(需修改开头几行token和ip这两处,设为你实际的):

<?php
// 配置信息
$token = "xxxxxxxxxxxxxxxxxxxxxxxxxxxxx";
$api_url = "https://volaryddns.net/api/update";
$ip = "xxx.xxx.xxx.xxx"; // 要更新的 IP 地址
$log_file = "volary_ddns_update.log";

// 构建请求数据
$data = [
    "token" => $token,
    "ip" => $ip
];

// 发送 POST 请求
$options = [
    "http" => [
        "header" => "Content-type: application/json\r\n",
        "method" => "POST",
        "content" => json_encode($data),
        "timeout" => 10,
    ],
];
$context = stream_context_create($options);

// 发送请求并获取响应
$response = @file_get_contents($api_url, false, $context);

// 日志记录函数
function log_message($log_file, $message) {
    $timestamp = date("Y-m-d H:i:s");
    $log_entry = "[$timestamp] $message\n";
    file_put_contents($log_file, $log_entry, FILE_APPEND);
}

// 处理响应
if ($response === FALSE) {
    $error = error_get_last();
    $error_message = "请求失败: " . $error['message'];
    log_message($log_file, $error_message);
    echo $error_message;
} else {
    log_message($log_file, "API 响应: " . $response);
    echo "API 响应: " . $response;
}
?>

用现有域名访问这个文件,如 http://yourdomain.com/update_volaryddns.php,会看到返回相应信息。

设置成功:
[2026-01-11 09:47:22] API 响应: {"message":"Successfully updated xyz.volaryddns.net to 185.50.25.57","success":true}

设置失败:
[2026-01-11 09:47:38] 请求失败: file_get_contents(https://volaryddns.net/api/update): failed to open stream: HTTP request failed! HTTP/1.1 429 Too Many Requests
(两次修改间隔太短)

设置成功之后可以登录后台看见历史记录,如下图。成功之后记得删掉上面的PHP文件和两个日志文件。
设置记录

为了防止滥用,两次 IP 更新之间有时间限制,大约是几分钟。

volaryddns的免费二级域名只支持设置一条A记录,无法设置其他类型的记录。

Saturday, 31 August 2024

ddns-by-liulilittle

 DDNS based on web-api implementation. 

Example

ddns.exe 10 "https://freemyip.com/update?token=799860a8a521350297219037&domain=ppp-nat-cdyd-1.freemyip.com"

Effect: ddns-sync every 10 seconds, domain name: "ppp-nat-cdyd-1.freemyip.com"
Apply for ddns: https://freemyip.com/ This is the free DDNS provider, or Google search yourself.

from https://github.com/liulilittle/ddns 

------------

a ddns script based on DNSPod and Cloudflare API.

简介

动态DNS更新脚本,目前支持DnsPod和CloudFlare

功能模块

  • 获取本机的公网地址
  • 更新DNS记录
  • 依靠systemd的timer运行,如公网地址没变则不发起更新请求

配置介绍

通过环境变量配置脚本:

  • PROVIDER: DNS服务商,目前支持dnspodcloudflare
  • TOKEN_ID: ID,对于DNSPod来说是token_id,对于CloudFlare说是用户邮箱
  • TOKEN_KEY: 验证密钥,对于DNSPod来说是token, 对于CloudFlare来说是api_key
  • DOMAIN: 域名,比如xdays.me
  • RECORD: 记录,比如www.xdays.me
  • IP_TYPE: 使用公网地址还是私网地址, 对应为publicprivate

安装

git clone git@github.com:xdays/ddns.git /opt/ddns

准备配置文件 /opt/ddns/.env

PROVIDER=cloudflare
TOKEN_ID=token_id
TOKEN_KEY=token_key
DOMAIN=example.com
RECORD=v.example.com
IP_TYPE=public

集成systemd

cd systemd
./install.sh 
from https://github.com/xdays/ddns 

 

 

Monday, 17 May 2021

收集的一些DDNS的工具


利用shell获得本机局域网IP

ifconfig -a|grep inet|grep -v 127.0.0.1|grep -v inet6|awk '{print $2}'|tr -d "addr:"

GO语言版

package main

import (
	"fmt"
	"net"
	"strings"
)

func main() {
	conn, err := net.Dial("udp", "google.com:80")
	if err != nil {
		fmt.Println(err.Error())
		return
	}
	defer conn.Close()
	fmt.Println(strings.Split(conn.LocalAddr().String(), ":")[0])
}

获取外网IP

新浪IP地址库

可以直接script标签引入

直接script引入 http://int.dpool.sina.com.cn/iplookup/iplookup.php?format=js

也支持 json 和文本格式

json 格式 http://int.dpool.sina.com.cn/iplookup/iplookup.php?format=json

文本格式 http://int.dpool.sina.com.cn/iplookup/iplookup.php

curl ip.cn 直接给出IP和运营商,浏览器访问不一样 类似于 curl myip.ipip.net

后面还可以跟一个IP地址,查询IP的位置. curl ip.cn/8.8.8.8 , 其网站还提供大陆IP列表,较快的DNS等等

curl ipinfo.io JSON格式,信息较全,可跨域,同样也可以查询指定IPcurl ipinfo.io/8.8.8.8,浏览器访问还会给出地图和网络运营商, http://speedsmart.net 可以测速

curl -i -H "Accept:application/json, text/javascript, */*; q=0.01" https://ipinfo.io

https://freegeoip.net 也提供json,xml,jsonp的详细信息 可用http 也可用https

curl ifconfig.me 速度较慢,浏览器访问不一样,直接给出IP

curl http://httpbin.org/get 直接给出所有请求头,JSON格式.

curl httpbin.org/ip 返回JSON包含IP

curl ip.gs 包含运行商,国家地区

curl cip.cc 包含运营商和地址

直接给出IP

curl ip.6655.com/ip.aspx
curl members.3322.org/dyndns/getip
curl icanhazip.com
curl whatismyip.akamai.com
curl myip.dnsomatic.com
curl ifconfig.co
curl https://api.ipify.org/
curl http://greak.net/ip

curl ipecho.net/plain

http://ip.chinaz.com/getip.aspx 比较详细的地理位置

淘宝的地址库

http://ip.taobao.com/service/getIpInfo2.php?ip=myip

https://jsonip.com/ 返回json数据IP,可以跨域

http://freegeoip.net/json/ 返回当前IP或者指定IP的地址位置和经纬度,支持json和jsonp?callback=fun

域名动态解析

花生壳接口

http://username:password@ddns.oray.com/ph/update?hostname=yourdomain 访问这个地址,会把域名绑定到访问这个地址的外网 ip 上。一般这个 ip 都是你路由器的 ip ,路由器再转发到树莓派上,用域名就可以直接访问树莓派了。 可以用计划任务一段时间更新一次

3322org接口

lynx -mime_header -auth=su:123 "http://members.3322.net/dyndns/update?system=dyndns&hostname=domain"

DNSPOD 接口

网友提供的操作库

https://github.com/xdtianyu/scripts/tree/master/ddns

https://github.com/lijyigithub/ddnspod/blob/master/ddnspod.py

https://github.com/anrip/ArDNSPod/blob/master/ddnspod.sh