Skip to main content

DNS Switcher for Ubuntu Gnome

Project description

Gnome appindicator dns switcher

https://pypi.org/project/gnome-dns-switcher/

Gnome appindicator (toolbar icon) tool to quickly switch between different DNS servers

  • Easily available in your toolbox
  • Config file to specify DNS servers Supports multiple connections and switching them separately
  • Utility button to restart NetworkManager

Screenshot of menu with DNS servers

💻 More screenshots

Easily available in your toolbar

Shows you what it's done, no surprises

Supports multiple connections and switching them separately

Setup

Install dependencies

# If you don't yet have pip3:
sudo apt install python3-pip

# Install dependencies to run this application
sudo apt install python3-gi python3-gi-cairo gir1.2-gtk-3.0 gir1.2-appindicator3-0.1

Install gnome-dns-switcher

# sudo so the script is added to $PATH, you can also install normally and fix $PATH :)
sudo pip3 install gnome-dns-switcher

# Generate a default configuration
gnome-dns-switcher generate-config

# Modify the config to your needs. See config documentation below
edit ~/.config/gnome-dns-switcher.yml

Usage

Start the app in the background

Simply add & after your command

gnome-dns-switcher &

Specify a different configuration file (default is ~/.config/gnome-dns-switcher.yml)

gnome-dns-switcher --config /path/to/config.yml

Add to startup applications

# Sleep 10 seconds before starting to prevent starting up 
# before network connections have been made
bash -c 'sleep 10 && gnome-dns-switcher --config ~/.config/gnome-dns-switcher.yml'

Config

The config file allows you to specify which DNS servers to show and what devices are visible. By default, gnome-dns-switcher looks for a config file at ~/.config/gnome-dns-switcher.yml

To generate and example configuration, you can run gnome-dns-switcher generate-config

The generated configuration will look like this:

servers: # DNS Server options to show
  # DHCP is always shown as the first option
  Quad9: 9.9.9.9
  CloudFlare: [1.1.1.1, 1.0.0.1]
  Google DNS:
    - 8.8.8.8
    - 8.8.4.4
devices: [] # Specify device names here if you want to hide certain devices (ip link show)

servers A list of servers that can be switched between

  • The name is only used for displaying
  • You can define one or more ips, as a yaml array or as a comma-seperated string

devices Which devices to show (optional)

  • optional, will display all non-bridge connections if not present or empty
  • one or more devices to show in the switcher
    • List all your devices by running ip link show in a terminal

Development

Setup

Set up virtualenv:

virtualenv venv
source venv/bin/activate

Install dependencies:

python setup.py install
pip install vext vext.gi

Running

python -m gnome_dns_switcher

Useful links

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

gnome-dns-switcher-1.3.0.tar.gz (21.0 kB view details)

Uploaded Source

Built Distribution

gnome_dns_switcher-1.3.0-py3-none-any.whl (21.7 kB view details)

Uploaded Python 3

File details

Details for the file gnome-dns-switcher-1.3.0.tar.gz.

File metadata

  • Download URL: gnome-dns-switcher-1.3.0.tar.gz
  • Upload date:
  • Size: 21.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.10.6

File hashes

Hashes for gnome-dns-switcher-1.3.0.tar.gz
Algorithm Hash digest
SHA256 ab342a2f30fdef884f95de44c88caf0c95b23373169564c62d8b8acce68b21ba
MD5 9c0ce4d3bfbbbe8c083e08f8d3fd5367
BLAKE2b-256 6c2f524c66d2d324309af827b8858b168ea13fc3427f36c09ae251d3c3840efa

See more details on using hashes here.

File details

Details for the file gnome_dns_switcher-1.3.0-py3-none-any.whl.

File metadata

File hashes

Hashes for gnome_dns_switcher-1.3.0-py3-none-any.whl
Algorithm Hash digest
SHA256 0746427259de9ad18b7356347c08cd4ce8e27b21ef1b53219e67372d457e94cb
MD5 c3fa96062833d3b12382838ffbb589fc
BLAKE2b-256 f4564c6616fb3087b9bce11c4fa7cd9b833801e16d671980bfefa46e822961a3

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page