- ddns_client
curl -sSL https://github.com/dingdangdog/cloudflare_ddns/raw/main/script/update_ddns.sh | bash- whoisme_server
curl -sSL https://github.com/dingdangdog/cloudflare_ddns/raw/main/script/update_whoisme.sh | bash- Download
ddns_clientin Last Release, or build ddns_client yourself; - Download
config.jsonin Last Release; - Please fill in your configuration information in
config.json, remember to delete the comments; - Put
ddns_clientandconfig.jsonin the same folder; - Set
ddns_clientas an executable file and run.
Find a way to get the real IP, and after getting the IP, call the Cloudflare API to modify the DNS record.
Tip: In the
Windowsdevelopment environment, please execute the command in theCMDterminal command line, not inPowerShell, otherwise the packaged result may not be executed normally
# Packaging Linux binary files in Windows development environment
cd ddns
SET GOOS=linux
SET GOARCH=amd64
go build -o ddns_client ddns.goA simple service that gets the client's public IP and returns it.
deploy on the server,
ddns clientrequests this interface of the server, obtains the client's real IP and returns it.
cd ip
go run whoisme.goTip: In the
Windowsdevelopment environment, please execute the command in theCMDterminal command line, not inPowerShell, otherwise the packaged result may not be executed normally
# Packaging Linux binary files in Windows development environment
cd ip
SET GOOS=linux
SET GOARCH=amd64
go build -o whoisme_server whoisme.go