RackPeek can generate a ready-to-use /etc/hosts file from your infrastructure model.
This is useful when you:
RackPeek stays the source of truth. Your hosts file just reflects it.
A resource is included if it has an address.
Define at least one:
labels:
ip: 192.168.1.20
or
labels:
hostname: server01.local
(If you already use Ansible, ansible_host also works.)
If no address is present, the resource is skipped.
- kind: System
name: vm-web01
tags:
- prod
labels:
ip: 192.168.1.20
RackPeek produces standard hosts entries:
127.0.0.1 localhost
::1 localhost
192.168.1.20 vm-web01
192.168.1.30 vm-db01
With a domain suffix:
--domain-suffix home.local
You’ll get:
192.168.1.20 vm-web01.home.local
rpk export hosts \
--include-tags prod \
--domain-suffix home.local \
--output hosts.txt
On macOS or Linux:
sudo cp hosts.txt /etc/hosts
Now you can:
ping vm-web01
No DNS required.