lolcathost logo
lolcathost

Dynamic Hosts File
Manager

Terminal interface for managing your /etc/hosts file with automatic backups, groups, presets, and a secure daemon architecture.

Version License Go Report

Features

Everything you need for managing local host entries

Interactive TUI

Beautiful terminal interface with real-time updates and keyboard navigation

Live Management

Add, edit, delete, and toggle host entries without restarting

Groups

Organize hosts into groups for better management

Presets

Save and apply preset configurations with a single command

Auto-Backup

Automatic backups before every change with rollback support

Secure Daemon

Privileged daemon handles file access via Unix socket IPC

Domain Blocking

Configurable domain blocklist to prevent dangerous entries

Cross-Platform

Works on macOS (LaunchDaemon) and Linux (systemd)

CLI & TUI

Both command-line and interactive modes for flexibility

Installation

Get started in under a minute

Homebrew (macOS/Linux)

brew install lukaszraczylo/taps/lolcathost
sudo lolcathost --install

Quick Install

curl -fsSL https://raw.githubusercontent.com/lukaszraczylo/lolcathost/main/install.sh | bash

Build from Source

git clone https://github.com/lukaszraczylo/lolcathost.git
cd lolcathost
make build
sudo ./build/lolcathost --install

Post-Installation

The installer will:

  • Install the binary to /usr/local/bin/lolcathost
  • Create a LaunchDaemon (macOS) or systemd service (Linux)
  • Start the daemon automatically
  • Create the default config at /etc/lolcathost/config.yaml

Usage

Simple and intuitive interface

Interactive Mode (TUI)

lolcathost

Keyboard Controls

Key Action
up/down or j/k Navigate entries
Space or Enter Toggle entry enabled/disabled
n Add new host entry
e Edit selected entry
d Delete selected entry
p Open preset picker
/ Search
r Refresh list
? Show help
q Quit

Status Indicators

Indicator Description
● Active Entry is enabled and in /etc/hosts
○ Disabled Entry is disabled
◔ Pending Operation in progress
✗ Error Operation failed

Configuration

Flexible YAML-based configuration

Config File Location

Configuration is stored at /etc/lolcathost/config.yaml and managed by the daemon.

  • TUI/CLI changes: Automatically saved to this file
  • Manual editing: Use sudo nano /etc/lolcathost/config.yaml (hot-reload enabled)

Example Configuration

# Groups for organizing host entries
groups:
  - name: development
    hosts:
      - domain: myapp.local
        ip: 127.0.0.1
        enabled: true
      - domain: api.myapp.local
        ip: 127.0.0.1
        enabled: true

  - name: staging
    hosts:
      - domain: staging.example.com
        ip: 192.168.1.100
        enabled: false

# Presets for quick configuration switching
presets:
  - name: work
    enable:
      - myapp.local
      - api.myapp.local
    disable:
      - staging.example.com

  - name: testing
    enable:
      - staging.example.com
    disable:
      - myapp.local

# Domain blocklist (prevent adding these domains)
blocklist:
  - google.com
  - facebook.com
  - github.com

Host Entry Fields

Field Required Description
domain Yes The hostname (e.g., myapp.local)
ip Yes IP address to resolve to
enabled No Whether entry is active (default: false)

CLI Commands

Scriptable command-line interface

lolcathost list

List all host entries

lolcathost enable <alias>

Enable a host entry by its alias

lolcathost disable <alias>

Disable a host entry by its alias

lolcathost add -d <domain> -i <ip> -g <group>

Add a new host entry

lolcathost delete <alias>

Delete a host entry by its alias

lolcathost preset <name>

Apply a named preset

lolcathost rollback <backup>

Restore from a backup

lolcathost status

Show daemon status

sudo lolcathost --install

Install the daemon service

sudo lolcathost --uninstall

Uninstall the daemon service

Architecture

Secure daemon-based design

Daemon

  • • Runs as root (LaunchDaemon/systemd)
  • • Handles /etc/hosts modifications
  • • Creates automatic backups
  • • Validates inputs (domain, IP)
  • • Rate limiting protection

Client (CLI/TUI)

  • • Runs as regular user
  • • Connects via Unix socket
  • • JSON protocol for commands
  • • No sudo required for operations
  • • Real-time status updates

Socket: /var/run/lolcathost.sock