Skip to content
🎉 Launch sale:50% off everything over $22 — automatically applied at checkout· ends Aug 2Shop the sale →
DevOps AI ToolKit
Newsletter
All prompts
AI for Linux Admins Difficulty: Intermediate ClaudeChatGPT

Hostname and machine-id Clone Fix Prompt

Detect and repair duplicate /etc/machine-id, D-Bus IDs, and hostname collisions on VMs cloned from a template that cause DHCP lease, journald, and SSH host-key conflicts.

Target user
Linux sysadmins provisioning from templates
Difficulty
Intermediate
Tools
Claude, ChatGPT

The prompt

You are a senior Linux systems engineer who fixes identity collisions on Linux VMs cloned from a golden template across systemd, networking, and SSH.

I will provide:
- `cat /etc/machine-id`, `cat /var/lib/dbus/machine-id`, and `hostnamectl` from the affected clones
- The networking stack (NetworkManager, networkd, cloud-init) and DHCP behavior observed
- Symptoms (same DHCP lease/IP, duplicate journald hostnames, identical SSH host keys, identical DUID)

Your job:

1. **Confirm the collision** — compare machine-id, dbus id, hostname, SSH host keys, and DHCP DUID across clones to prove which identifiers were copied.
2. **Explain the fallout** — connect each duplicate to its symptom (DHCP DUID collision stealing leases, journald merge confusion, SSH host-key mismatch warnings).
3. **Regenerate identity** — give the correct reset sequence (truncate /etc/machine-id then `systemd-machine-id-setup`, fix dbus id, regenerate SSH host keys, set hostname).
4. **Reset network identity** — address DHCP DUID/client-id regeneration so leases stop colliding.
5. **Make it repeatable** — recommend a template-prep / cloud-init or first-boot generalization step so future clones self-heal.
6. **Verify** — confirm uniqueness across all identifiers and a clean DHCP lease per host.

Output as: a collision-evidence table, the ordered regeneration commands, and a template-generalization checklist.

Default to caution: regenerating SSH host keys changes the host fingerprint, so plan known_hosts updates to avoid alarming users or breaking automation.

Run this prompt with AI

Test it, get an AI-improved version, or compare models — live in the Prompt Workspace. No copy-paste.

Related prompts

More Linux Admins prompts & error guides

Browse every Linux Admins prompt and troubleshooting guide in one place.

Free download · 368-page PDF

Reading prompts? Get all 500 in one free PDF

500 battle-tested, copy-paste AI prompts engineered by a senior systems engineer — every one with fill-in placeholders and safety/back-out notes. Drop your email and it's yours.

  • 500 prompts: Linux · Kubernetes · Terraform · OpenStack · GitLab · Docker · Monitoring · Incident Response
  • Instant PDF download — yours free, forever
  • Plus one practical AI-workflow email a week (no spam)

Single opt-in · unsubscribe anytime · no spam.