Remove Command

Completely uninstall NexoralDNS from your system. This command removes all services, data, configurations, and restores your original system settings.

Critical Warning:

This action is IRREVERSIBLE! The remove command will permanently delete all DNS records, custom configurations, query logs, cache data, and user settings. Make sure to backup any important data before proceeding.

Command

curl -fsSL https://raw.githubusercontent.com/nexoral/NexoralDNS/main/Scripts/install.sh | bash -s remove

What It Does

The remove command performs a complete uninstallation of NexoralDNS from your system. It executes the following operations:

Removal Process:

  • Prompts for confirmation before proceeding
  • Stops all running NexoralDNS containers
  • Removes all NexoralDNS Docker containers
  • Deletes all NexoralDNS Docker images
  • Removes all Docker volumes (containing all data)
  • Deletes NexoralDNS Docker networks
  • Removes NexoralDNS installation directory
  • Restores original DNS configuration
  • Cleans up system configuration files
  • Removes scheduled tasks and cron jobs (if any)

What Gets Removed

All Services

Every NexoralDNS service is permanently removed:

  • DNS Server: Complete removal including all DNS configurations
  • Cache Manager: All cache data and configurations deleted
  • Web Dashboard: Dashboard application and all user data removed
  • Database: All stored data including query logs permanently deleted

All Data

The following data is permanently deleted:

  • Custom DNS records and domain mappings
  • Block lists and filtering rules
  • Query logs and analytics history
  • Cache statistics and performance data
  • User accounts and authentication credentials
  • Dashboard settings and preferences
  • API keys and integration tokens
  • Backup files (if stored in installation directory)

System Configuration

System settings are restored to pre-installation state:

  • DNS configuration in /etc/resolv.conf restored to original
  • Port 53 and 4000 released and available for other services
  • System firewall rules related to NexoralDNS removed
  • Systemd services (if any) unregistered and removed

What Is NOT Removed

The following are intentionally preserved:

  • Docker: Docker and Docker Compose remain installed
  • Dependencies: System packages installed as dependencies
  • Router Settings: You must manually change router DNS settings
  • External Backups: Backups stored outside the installation directory

Confirmation Process

To prevent accidental deletion, the remove command requires explicit confirmation:

WARNING: This will permanently remove NexoralDNS and ALL data!

This action will delete:
  â€ĸ All DNS records and configurations
  â€ĸ Query logs and analytics data
  â€ĸ User accounts and settings
  â€ĸ Cache data and statistics

This action is IRREVERSIBLE!

Type 'yes' to confirm removal, or anything else to cancel: 

You must type yes (case-sensitive) and press Enter to proceed. Any other input will cancel the operation.

Expected Output

After confirmation, a successful removal will display:

Confirmation received. Proceeding with removal...

[✓] Stopping all services...
Stopping nexoraldns-dashboard   ... done
Stopping nexoraldns-cache       ... done
Stopping nexoraldns-dns-server  ... done

[✓] Removing containers...
Removing nexoraldns-dashboard   ... done
Removing nexoraldns-cache       ... done
Removing nexoraldns-dns-server  ... done

[✓] Removing images...
Deleted: nexoral/dns-server:latest
Deleted: nexoral/cache-manager:latest
Deleted: nexoral/dashboard:latest

[✓] Removing volumes...
Deleted: nexoraldns_dns-data
Deleted: nexoraldns_cache-data
Deleted: nexoraldns_db-data

[✓] Removing networks...
Deleted: nexoraldns_default

[✓] Removing installation directory...
[✓] Restoring original DNS configuration...
[✓] Cleaning up system files...

NexoralDNS has been completely removed from your system.

Original DNS configuration restored.
All data has been permanently deleted.

Thank you for using NexoralDNS!

Pre-Removal Backup

If you want to preserve your data before removal, create a manual backup:

Backup Custom DNS Records

# Export DNS records from dashboard\n# Go to: Settings → Export Data → Download DNS Records\n\n# Or manually backup configuration\nsudo cp -r /var/lib/nexoraldns/dns-config ~/nexoraldns-backup/

Backup Query Logs

# Export query logs from dashboard\n# Go to: Analytics → Export Logs → Download\n\n# Or backup database volume\nsudo docker run --rm -v nexoraldns_db-data:/data -v ~/nexoraldns-backup:/backup \\\n  alpine tar czf /backup/db-backup-$(date +%Y%m%d).tar.gz -C /data .

Backup User Settings

# Export all settings from dashboard\n# Go to: Settings → Export All → Download Configuration

Backup Recommendation:

Even if you plan to reinstall NexoralDNS later, backing up your custom configurations can save significant time. DNS records, block lists, and custom rules can be time-consuming to recreate.

Manual Removal Process

If you prefer to remove components manually or the automated script fails:

Step 1: Stop and Remove Containers

cd /path/to/NexoralDNS/Scripts\nsudo docker compose down -v

Step 2: Remove Images

sudo docker rmi $(sudo docker images 'nexoral/*' -q)

Step 3: Remove Installation Directory

sudo rm -rf /path/to/NexoralDNS

Step 4: Restore DNS Configuration

sudo nano /etc/resolv.conf\n# Remove or replace NexoralDNS nameserver entries

Step 5: Clean Docker System (Optional)

# Remove unused Docker resources\nsudo docker system prune -a --volumes

Post-Removal Steps

Update Router DNS Settings

After removing NexoralDNS, you must manually update your router's DNS configuration:

  1. Access your router's admin panel
  2. Navigate to DNS or DHCP settings
  3. Remove your machine's IP from DNS server settings
  4. Set DNS to your ISP's servers or public DNS (e.g., 8.8.8.8, 1.1.1.1)
  5. Save settings and restart router if needed

Release Static IP Reservation

If you reserved a static IP for the NexoralDNS machine:

  1. Access router admin panel
  2. Go to DHCP reservation settings
  3. Remove the reservation for your machine
  4. Save changes

Verify Complete Removal

Confirm all components are removed:

# Check for containers\nsudo docker ps -a | grep nexoral\n\n# Check for images\nsudo docker images | grep nexoral\n\n# Check for volumes\nsudo docker volume ls | grep nexoral\n\n# Check DNS configuration\ncat /etc/resolv.conf

All commands should return no results.

Troubleshooting Removal

Removal Script Fails

Problem: Automated removal script encounters errors.

Solution: Use manual removal process outlined above.

Containers Won't Stop

Force kill containers:

sudo docker kill $(sudo docker ps -q --filter 'name=nexoraldns')

Volumes Won't Delete

Force remove volumes:

sudo docker volume rm $(sudo docker volume ls -q | grep nexoraldns) --force

Permission Denied Errors

Ensure running with sudo:

sudo curl -fsSL https://raw.githubusercontent.com/nexoral/NexoralDNS/main/Scripts/install.sh | sudo bash -s remove

Last Resort:

If you cannot remove NexoralDNS through normal means, you can forcefully delete all Docker resources: sudo docker system prune -af --volumes. WARNING: This removes ALL Docker containers, images, and volumes on your system, not just NexoralDNS!

Reinstalling After Removal

If you want to reinstall NexoralDNS after removal:

curl -fsSL https://raw.githubusercontent.com/nexoral/NexoralDNS/main/Scripts/install.sh | bash -

This will perform a fresh installation. To restore from backup:

# After fresh installation, restore DNS records through dashboard\n# Go to: Settings → Import → Upload Backup File\n\n# Or manually restore configuration\nsudo cp -r ~/nexoraldns-backup/* /var/lib/nexoraldns/dns-config/\nsudo docker compose restart

Alternatives to Complete Removal

Before removing NexoralDNS completely, consider these alternatives:

Stop Services Instead

If you want to temporarily disable NexoralDNS without losing data:

curl -fsSL https://raw.githubusercontent.com/nexoral/NexoralDNS/main/Scripts/install.sh | bash -s stop

See the stop command documentation for details.

Reset to Default Configuration

To keep NexoralDNS but reset all settings:

# This preserves installation but resets data\nsudo docker compose down -v\nsudo docker compose up -d

Feedback

If you're removing NexoralDNS, we'd love to hear why:

  • Open an issue on GitHub with feedback
  • Share your experience to help us improve
  • Let us know what features you'd like to see

Related Commands