https://github.com/ittykeys/dns-toggle
Simple GUI toggle for /etc/resolv.conf
https://github.com/ittykeys/dns-toggle
c dns linux resolv-conf
Last synced: about 1 month ago
JSON representation
Simple GUI toggle for /etc/resolv.conf
- Host: GitHub
- URL: https://github.com/ittykeys/dns-toggle
- Owner: ittykeys
- License: gpl-3.0
- Created: 2025-08-18T00:16:30.000Z (10 months ago)
- Default Branch: master
- Last Pushed: 2025-12-03T10:07:25.000Z (7 months ago)
- Last Synced: 2025-12-06T13:08:51.842Z (7 months ago)
- Topics: c, dns, linux, resolv-conf
- Language: C
- Homepage:
- Size: 30.3 KB
- Stars: 0
- Watchers: 0
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# DNS Toggle


## Description
Simple GUI toggle for /etc/resolv.conf for us old dogs still handling DNS that way.
### Features
* Toggling between 2 main DNS servers
* Toggle for a 3rd DNS server that overrides the 2 main (useful for VPN etc)
* Handles empty /etc/resolv.conf and creates it when we toggle
* Should leave alone things like domain, search and comments
### Dependencies
* libgtk-3-dev
* librsvg2-dev
### Build
Make file **nameservers.conf** before building, example:
```
nameserver 1.1.1.1
nameserver 8.8.8.8
nameserver 9.9.9.9
```
Then:
```bash
sudo apt install libgtk-3-dev librsvg2-dev build-essential
git clone git@github.com:ittykeys/dns-toggle.git
cd dns-toggle
make
```
### Run
Please backup your precious /etc/resolv.conf before running:
```bash
sudo cp /etc/resolv.conf /etc/resolv.conf.bk
```
Then:
```bash
./dns-toggle
```
It will ask for authentication via **pkexec** when toggling.
##### Todo
* Detect and re-toggle previous state (and toggle state) properly after 3rd dns toggled (especially at startup).
* Detect and error out if /etc/resolv.conf is handled by another system.
* Future-proof for gtk4
* Add flag to auth immediately at launch, negating the need for auth every toggle
* Windows version (are network connection options exposed via win api?)
* Pack assets in executable
* Don't block main gui thread for auth (#3500)
* KDE widget (#3480)
* Option to modify DNS at startup (#3523)
* Mobile app (#3538)
* Temp file while active (#3544)
### License
This project is licensed under the GNU General Public License - see the [License file](LICENSE) file for details.