- go版本:go 1.20
- git clone 主分支
- go build
- 添加运行用户:useradd ddns
- 使用systemd管理
- 创建ddns.service
vim /etc/systemd/system/ddns.service
[Unit]
Description=Prometheus
After=network.target
[Service]
Type=simple
WorkingDirectory=/Data/ddns
User=ddns
Group=ddns
ExecStart=/Data/ddns/tools -inifilename /Data/ddns/config.ini
Restart=on-failure
RestartSec=5
LimitNOFILE=65536
[Install]
WantedBy=multi-user.target
systemctl daemon-reload
# 启动ddns
systemctl start ddns.service
# 开启开机自动启动
systemctl enable ddns.service
# 查看运行状态
systemctl status ddns.service
=============================English==================================
- Acquire dynamic public IP, supporting both IPv4 and IPv6
- To enable IPv6 support, modify the update_ipv4_url in the configuration file to an IPv6 address, which can be obtained from http://dynv6.com. Also, change the get_wan_ip_url in the configuration file to: http://v6.ipinfo.io/
- For IPv4, acquire the public IP address from:http://ipinfo.io/
- For IPv6, acquire the public IP address from: http://v6.ipinfo.io/
Configuration File Description
- Modify according to the comments in the configuration file: config.ini
- Go version:go 1.20
- Git clone the master branch
- Go build
Program Start-up Instructions
- Add a runtime user: useradd ddns
- Managed using systemd
- Create ddns.service
vim /etc/systemd/system/ddns.service
[Unit]
Description=Prometheus
After=network.target
[Service]
Type=simple
WorkingDirectory=/Data/ddns
User=ddns
Group=ddns
ExecStart=/Data/ddns/tools -inifilename /Data/ddns/config.ini
Restart=on-failure
RestartSec=5
LimitNOFILE=65536
[Install]
WantedBy=multi-user.target
systemctl daemon-reload
# Start ddns
systemctl start ddns.service
# Enable auto-start at boot
systemctl enable ddns.service
# Check the running status
systemctl status ddns.service
- Specific registration and usage will not be explained further