Hi everyone,I built InvDNS because I got tired of constantly opening Ansible inventory files just to find the IP of a host.
InvDNS reads static Ansible INI/YAML inventories and turns hosts into local DNS names on macOS.
Ansible knows that web01 means ansible_host: 10.20.1.15, so Ansible can connect to it. But normal macOS applications such as ssh, ping or curl do not know anything about your Ansible inventory.
If web01 also does not exist in corporate DNS, you usually end up doing something like:
grep web01 inventory.yml
ssh root@10.20.1.15
InvDNS makes the existing Ansible host/IP mapping available through local DNS on macOS.
After adding the inventory to InvDNS, I can simply use:
ssh root@web01.inv
ping web01.inv
curl http://web01.inv
It does not modify your inventory, /etc/hosts, or corporate DNS. Everything stays local on your.
One reason I built it as a tool rather than just a small script is automatic synchronization. InvDNS keeps watching the configured inventories and updates the local DNS when the inventory changes, so I don't have to regenerate anything manually.
It can also use multiple inventory files at the same time. For example, I can add inventories from several projects or environments and access all of their hosts through the same local DNS.
InvDNS can also combine host information from different infrastructure data sources. Ansible is the main use case, but other sources such as Zabbix or GLPI can be used alongside it.
If the same hostname appears in multiple inventories or sources with different IP addresses, InvDNS detects the conflict instead of silently choosing one. Conflicts can then be reviewed and resolved explicitly.
It also has fast CLI search:
invdns search web
invdns search ip:10.20.
invdns search group:nginx
invdns search group:nginx ip:10.20.
So you can quickly search by hostname, IP, Ansible group, source, or status.
project-a/inventory.yml ─┐
project-b/hosts.ini ─────┤
production/hosts.yml ────┼→ InvDNS → *.inv
Zabbix ──────────────────┤
GLPI ────────────────────┘
Project:
https://github.com/invdns/invdns
I’d be interested to know whether this kind of workflow is useful to other Ansible users, and what inventory/search features you would want next.