RDNS resolution for ipv6 clients who got address from SLAAC. This project updates /etc/hosts which can then be read by a resolver to respond to ptr queries in queries in your local search domain
src | ||
.gitignore | ||
Cargo.lock | ||
Cargo.toml | ||
README.md |
rdns-ipv6
In dual stack networks, This project can help in rdns resolution of IPv6 addresses by reusing hostname from DHCPv4 leases for that client.
It works like this,
- Read IPv6 neighbours on the machine.
- Identify hostname for this IPv6 client by trying to find a IPv4 lease for this MAC address
- Update
/etc/hosts
with a list of IPv4 and IPv6 records.
There should be unbound
or some other DNS resolver running on the machine to read /etc/hosts
and respond to PTR queries and queries in your local search domain.
This program does not handle any aspect related to that.
This program exits after modifying /etc/hosts
. It can be used with systemd to run at some interval.
It might be better to run this some how on netlink events, I have not looked into it yet.
# /etc/systemd/system/rdns-ipv6.timer
[Unit]
Description=rdns-ipv6
[Timer]
OnUnitActiveSec=30s
OnBootSec=30s
[Install]
WantedBy=timers.target
#/etc/systemd/system/rdns-ipv6.service
[Unit]
Description=RDNS for IPv6
[Service]
Type=oneshot
ExecStart=/config/rdns-ipv6