I want to be able to easily and frequently edit my hosts file from a quick GUI. Any one know of one that exists?
Thanks!
I want to be able to easily and frequently edit my hosts file from a quick GUI. Any one know of one that exists?
Thanks!
As already answered hosts is just a text file so you can use any text editor. Since it exists in /etc and you cannot edit as general user you need to use sudo. The graphical frontend to sudo is gksu. So basically doing gksu YOUR_GRAPHICAL_EDITOR /etc/hosts will do it OR you can use terminal with nano and vim. I recommend nano as it is quite easy.
sudo nano /etc/hosts
In order to ease the command you can use alias.
So edit your .bashrc file in your $HOME. i.e.
In your terminal do:
nano .bashrc
Add
alias edithosts='gksu YOUR_GRAPHICAL_EDITOR /etc/hosts' OR 'sudo nano/vim/vi /etc/hosts'
and save it with Ctrl+x. And do source ~/.bashrc. Then you can use edithosts from commandline to use it.
If you use unity you may use quicklist as well What Custom Launchers and Unity Quicklists are available?
sagarchalise's answer is great, I also discovered gnome-network-admin which includes a pretty nice interface to edit hosts
sudo apt install gnome-network-admin
It's not a special editor as such, but you could always Alt+F2 gksudo gedit /etc/hosts.
try one from electron apps - it has GUI, but need some manipulation with node.js installation - githab README.md has detailed info. https://electron.atom.io/apps/?q=hosts
For those of you who use XFCE, I've written xfce-hosts-plugin to quickly toggle hosts in /etc/hosts.
I'm developing HomA (Home Automation) that displays your required /etc/hosts in a GUI along with arp -a, hostnamectl status and ip addr combined into a unified view. It may suit your purpose.
It runs in Python 2.7.12+ and Python 3.5+ with Tkinter 8.6 (read Ubuntu 16.04 LTS ECM/Plus to Ubuntu 24.04 LTS) but may have difficulties with new experimental threads in Tkinter 9.0 in Python 3.13.
Here's a short .gif super compressed from an .mp4 video in order to fit in Stack Overflow from the website:
This might be "GUI overkill" to your question, because it assigns an image to hosts in /etc/hosts, lets you turn them on and off, etc.
What you are seeing on the GUI comes from /etc/hosts:
127.0.0.1 localhost
127.0.1.1 Alien
192.168.0.1 Hitronhub.home Admin a8:4e:3f:82:98:b2
192.168.0.10 Alien AW 17R3 WiFi 9c:b6:d0:10:37:f7
192.168.0.12 Alien AW 17R3 Ethernet 28:f1:0e:2a:1a:ed
192.168.0.11 Phone Moto E4 Plus fc:d4:36:ea:82:36
192.168.0.13 Dell Inspiron 17R-SE-7720 Ethernet 5c:f9:dd:5c:9c:53
192.168.0.14 Dell Inspiron 17R-SE-7720 WiFi 60:6c:66:86:de:bd
192.168.0.15 SONY.Light hs100 Sony TV Bias Light 50:d4:f7:eb:41:35
192.168.0.16 SONY.WiFi Sony Bravia KDL TV WiFi 18:4f:32:8d:aa:97
192.168.0.17 TCL.LAN TCL / Google TV Ethernet c0:79:82:41:2f:1f
192.168.0.18 TCL.WiFi TCL / Google TV WiFi fc:d4:36:ea:82:36
192.168.0.19 SONY.LAN Sony Bravia KDL TV Ethernet ac:9b:0a:df:3f:d9
192.168.0.20 TCL.Light hs100 TCL TV Bias Light 50:d4:f7:eb:46:7c
192.168.0.21 TCL.LAN2 amazon-54d22a1a9.hitronhub 98:28:a6:ba:76:f6
192.168.0.22 F3_Pro Umidigi F3 Pro 5G 46:f0:89:36:f5:1d
192.168.0.254 Router.Login Hitron Technology 00:05:ca:00:00:09