Thứ Hai, 19/05/2025
Loading...
  • Login
Hoàng Giang Nam Blog
  • Home
  • WordPress
    • WordPress
    • Woocommerce
  • Windows
  • Office
  • Phần Mềm
  • Thủ thuật
  • Linux
    • Ubuntu
    • CentOS
    • VPS – Server
    • Web Server
No Result
View All Result
Hoàng Giang Nam Blog
  • Home
  • WordPress
    • WordPress
    • Woocommerce
  • Windows
  • Office
  • Phần Mềm
  • Thủ thuật
  • Linux
    • Ubuntu
    • CentOS
    • VPS – Server
    • Web Server
No Result
View All Result
  • Login
Hoàng Giang Nam Blog
No Result
View All Result
Home Web Server
Tự động cập nhật bản ghi DNS khi thay đổi IP

Tự động cập nhật bản ghi DNS khi thay đổi IP

admin by admin
01/01/2025
Share on FacebookShare on Twitter

Mục lục

  1. Cloudflare DNS Auto IP Updater
    1. Requirements:
    2. Optional:
    3. Installation:

Tôi đã tạo một tập lệnh Python tự động cập nhật các bản ghi DNS của trang web của mình bất cứ khi nào IP động của tôi thay đổi (tôi không thể mua IP tĩnh), vì vậy tôi đã đặt một phiên bản đã sửa đổi của tập lệnh mà tôi sử dụng cho máy chủ của mình trên Github!

Nó có thể gửi cho bạn một email khi cập nhật các bản ghi và cũng ghi nhật ký các thay đổi vào một tệp.

Tôi hy vọng điều này sẽ giúp bất kỳ ai gặp vấn đề tương tự như tôi đã từng! Hãy cho tôi biết nếu bạn gặp bất kỳ vấn đề nào với nó.

https://github.com/pigeonburger/cloudflare-ip

Download file: cloudflare-ip-main.zip

Cloudflare DNS Auto IP Updater

This is a script I made that will automatically update my A record’s IP address whenever my web server’s IP changes.

I don’t have (nor can I afford) a static ip, meaning that my IP address constantly changes. Whenever it does change (usually while I’m sleeping), it means that my site becomes completely inaccessible. So, I attempted to create a solution, which is this script. It can also send you an email and log all IP changes to a file to let you know it’s been updated.

Be aware, this only works if your site is on the Cloudflare CDN. See the requirements below:

Requirements:

  • Python 3.6 or above
  • Python requests library (install using pip3 install requests)
  • A Cloudflare account with website
  • Cloudflare API Bearer Token
  • Need to know your zone ID
  • The ID of the A record you want to change

Optional:

  • SMTP email, to send an update when the IP changes

Installation:

On your web server, in any directory, clone this repository:

git clone https://github.com/pygeonburger/cloudflare-ip/

Then, open the file cfauth.ini in that folder and replace <YOUR_ZONE_ID> with your actual Cloudflare Zone ID, <YOUR_BEARER_TOKEN> with your API bearer token and <YOUR_DNS_RECORD_ID> with the ID of the DNS record you want to change.

If you want email support, add your SMTP details, otherwise just delete everything at the bottom of the script.

Then, if you’ve done everything, run the cfautoupdater.py file!

Tags: Cloudflare
admin

admin

Next Post
Delete custom field in database wordpress

Thêm nút bổ sung Mua hàng qua Shopee , Tiki, Lazada

Please login to join discussion

Recommended.

Cài LEMP & TOR trên Ubuntu 20.04

18/12/2024
Sử dụng Nginx làm Reverse Proxy cho nhiều trang web

Sử dụng Nginx làm Reverse Proxy cho nhiều trang web

18/12/2024

Trending.

HuananZhi X79 / X99 Motherboard BIOS POST codes

HuananZhi X79 / X99 Motherboard BIOS POST codes

01/01/2025
Xóa, Sửa, Nâng dung lượng RAM ẢO – Swap trên Ubuntu

Xóa, Sửa, Nâng dung lượng RAM ẢO – Swap trên Ubuntu

01/01/2025
Tạo file IMG Windows.GZ bằng VM VirtualBox để cài đặt trên VPS Digitalocean, Linode

Tạo file IMG Windows.GZ bằng VM VirtualBox để cài đặt trên VPS Digitalocean, Linode

31/12/2024
Tăng / Giảm giá SALE toàn bộ cửa hàng, Xóa Giá Sale

Tăng / Giảm giá SALE toàn bộ cửa hàng, Xóa Giá Sale

01/01/2025

GG One 1năm

18/12/2024
Hoàng Giang Nam

Blog chia sẽ kiến thức lập trình, source code, themes, plugin, phần mềm & thủ thuật máy tính...

Follow Us

Danh mục

  • CentOS
  • Chung
  • Server Email
  • Thủ thuật máy tính
  • Ubuntu
  • VPS – Server
  • Web Server
  • Windows
  • Woocommerce
  • Wordpress

Recent News

Disable Web Search Results in Windows 10/11 Start Menu

16/01/2025
Hướng dẫn lấy Client ID + Client Secret + Refresh Token Google Drive API

Hướng dẫn lấy Client ID + Client Secret + Refresh Token Google Drive API

19/12/2024
  • About
  • Advertise
  • Privacy & Policy
  • Contact

© 2024 Hoanggiangnam.com

No Result
View All Result
  • Home
  • Phần Mềm
  • Thủ thuật máy tính
  • WordPress
  • Ubuntu
  • Office
  • Photography
  • Windows

© 2024 Hoanggiangnam.com

Welcome Back!

Login to your account below

Forgotten Password?

Retrieve your password

Please enter your username or email address to reset your password.

Log In
Click to Copy