This Python script allows you to create, list, and delete DNS records in Cloudflare. It is designed to work with Python 3.6 or higher and requires the requests library.
- python (version 3.6 or higher)
- Libraries
requests
- Install Python 3.6 or higher if you haven't already.
- Create a new folder for the project.
- Clone the 1CF_dns_manager1 repository into your project folder:
git clone https://github.com/ImanMontajabi/CF_dns_manager.git
- Edit the user_id.json file with your Cloudflare account-related information.
- Obtain a .json file from Morteza Bashsiz script/ app that there is in result folder that contains your Cloudflare DNS scan data. Save it to your project folder and name it scan finally it is scan.json.
- Open a command prompt or terminal window and navigate to your project folder.
- Create a Python virtual environment by running:
python -m venv venv
- Activate the virtual environment by running (with CMD in Windows):
.\venv\Scripts\activate.bat
- Install the
requests
library by running:
pip install requests
To see a list of your DNS records, run the list_ip.py
script:
python list_ip.py
This will display a table of all of your current DNS records in Cloudflare.
To create your DNS records, run the create_ip.py
script:
python create_ip.py
To delete DNS record, run the delete_ip
.py script:
python delete_ip.py
This project is licensed under the MIT license. Please make sure to thoroughly read the license before using and/or modifying this script
If you run into any issues or have questions about this script, please see the discussions open an issue in this repository.
Additionally, feel free to contribute to the project by submitting a pull request or offering suggestions for improvement.