Flush DNS

Flush DNS cache with history tracking

LLA Flush DNS Plugin

DNS cache flushing plugin for lla with history tracking and cross-platform support.

Features

  • Cross-Platform: Works on macOS, Linux, and Windows
  • History Tracking: Track all flush operations with timestamps
  • Confirmation Prompts: Optional confirmation before flushing
  • Statistics: View flush history and success rates

Configuration

Configuration file location: ~/.config/lla/plugins/flush_dns/config.toml

confirm_before_flush = true
show_verbose_output = true
max_history_size = 50
 
[colors]
success = "bright_green"
info = "bright_cyan"
warning = "bright_yellow"
error = "bright_red"

Usage

Flush DNS cache

lla plugin --name flush_dns --action flush

This will:

  1. Show confirmation prompt (if enabled)
  2. Execute the appropriate flush command for your OS
  3. Display success/failure message
  4. Show verbose output (if enabled)
  5. Save the operation to history

View flush history

lla plugin --name flush_dns --action history

Displays:

  • List of recent flush operations
  • Timestamps
  • Operating system
  • Success/failure status
  • Statistics (total, successful, failed)

Clear flush history

lla plugin --name flush_dns --action clear-history

Prompts for confirmation and clears all flush history.

Configure preferences

lla plugin --name flush_dns --action preferences

Adjust settings:

  • Toggle confirmation before flush
  • Toggle verbose output
  • Set max history size

Display help

lla plugin --name flush_dns --action help

Display Examples

Flushing DNS

 Info: Flushing DNS cache on macOS...
 Success: DNS cache flushed successfully!

History View

📜 DNS Flush History:
──────────────────────────────────────────────────────────────────────
 2025-10-20 16:30:45 [macOS] Success
 2025-10-20 15:20:30 [macOS] Success
 2025-10-20 14:15:22 [macOS] Failed
──────────────────────────────────────────────────────────────────────
 
📊 Statistics:
 Total flushes: 25
 Successful: 24
 Failed: 1

Platform Commands

  • macOS: sudo dscacheutil -flushcache && sudo killall -HUP mDNSResponder
  • Linux: sudo systemd-resolve --flush-caches or sudo systemctl restart nscd
  • Windows: ipconfig /flushdns

Actions

  • flush - Flush the DNS cache
  • history - View flush history
  • clear-history - Clear flush history
  • preferences - Configure plugin preferences
  • help - Show help information

Troubleshooting

macOS

If the flush fails, you may need to run with sudo permissions. The plugin attempts to use sudo automatically.

Linux

The plugin tries multiple methods:

  1. systemd-resolve --flush-caches (for systemd-based systems)
  2. systemctl restart nscd (for systems using nscd)

If both fail, you may need to manually install one of these services.

Windows

The command requires administrator privileges. Run your terminal as administrator if the flush fails.

Common Use Cases

After Changing DNS Settings

lla plugin --name flush_dns --action flush

Troubleshooting Network Issues

When experiencing DNS resolution problems, flushing the cache can help:

lla plugin --name flush_dns --action flush

After Editing /etc/hosts

Clear DNS cache to ensure new host entries are recognized:

lla plugin --name flush_dns --action flush