Overview
Cloudflare's dashboard is great on a laptop and painful on a phone — especially on prepaid data. This bot replaces the whole workflow with a Telegram conversation. You type /cname, choose a domain from a button, send the target, and Cloudflare creates the record. That's it.
The project is open source under the MIT license, ships with a render.yaml for one-click deploys, and exposes a /health endpoint so a free UptimeRobot monitor keeps it awake around the clock.
Features
Data-cheap by design
Telegram text commands cost under 1 KB. The Cloudflare dashboard loads 2–5 MB per visit.
Locked to you
Only chat IDs listed in ALLOWED_CHAT_IDS get a response. Everyone else is ignored.
Inline button picker
Choose the exact zone from buttons built live from your Cloudflare account — no typing domain names.
Self keep-alive
Ships a /health endpoint that Render and UptimeRobot use to keep the service hot 24/7.
Extensible
Adding /a, /txt, /mx, and delete flows is a matter of one handler each.
Zero cost
Render free tier plus UptimeRobot free tier — the whole stack runs at $0 per month.
Flow
A full DNS change, start to finish, from Telegram.
You /cname Bot Step 1/3 — Send the subdomain name you want to create. Example: mysub You mysub Bot Step 2/3 — Pick the full domain for mysub: [ mysub.example.com ] [ mysub.example.net ] [ mysub.example.org ] [ Cancel ] You ( taps mysub.example.com ) Bot Step 3/3 — Selected: mysub.example.com Now send the target hostname. Example: user.github.io You user.github.io Bot DNS record created successfully. Domain: mysub.example.com Type: CNAME Target: user.github.io Proxied: Yes TTL: Auto
Quick start
- Fork the repository. Open github.com/realximanta/cf-telegram-bot and click Fork.
- Create a Telegram bot. Message @BotFather, run
/newbot, and copy the token. - Get your Telegram ID. Message @userinfobot and copy the numeric ID.
- Create a Cloudflare API token. Go to Cloudflare API Tokens, use the Edit zone DNS template, keep
Zone:ReadandDNS:Edit, scope it to the zones you want. - Deploy on Render. New → Blueprint → select your fork → fill the three env vars.
- Keep it alive. Add an UptimeRobot monitor on
https://<your-service>.onrender.com/health, interval 5 minutes.
Deploy
Render reads the render.yaml Blueprint from your fork automatically. You only need to provide three environment variables.
# .env TELEGRAM_TOKEN="123456789:AAYourTokenFromBotFather" CF_API_TOKEN="your_cloudflare_api_token" ALLOWED_CHAT_IDS="123456789" # comma-separated PORT=8080 # Render injects this automatically
Once Render reports a healthy deploy you can message your bot on Telegram and run /start.
Clone
Prefer to run it locally first?
# HTTPS git clone https://github.com/realximanta/cf-telegram-bot.git # SSH git clone git@github.com:realximanta/cf-telegram-bot.git # GitHub CLI gh repo clone realximanta/cf-telegram-bot cd cf-telegram-bot python -m venv .venv && source .venv/bin/activate pip install -r requirements.txt cp .env.example .env # fill in your secrets python bot.py
FAQ
Is this really free to run?
Yes. The code is MIT licensed, and the recommended stack — Render's free web service plus a free UptimeRobot monitor — costs nothing.
How much mobile data does it actually use?
A full DNS change over Telegram is under 1 KB round-trip. Opening the Cloudflare dashboard once is 2–5 MB of HTML, JS, and fonts.
Can somebody else use my bot if they find it?
No. The bot ignores every chat ID that isn't listed in ALLOWED_CHAT_IDS. Only you get a response.
Which record types are supported today?
CNAME. A, AAAA, TXT, MX, SRV, and delete flows are on the roadmap.
Why do I need UptimeRobot?
Render's free tier sleeps after roughly 15 minutes of inactivity. UptimeRobot pings the bot's /health endpoint every 5 minutes to keep it hot.
Contact
Repository: github.com/realximanta/cf-telegram-bot
Author: @realximanta · realximanta@gmail.com