Docker container names as client names?

Yes, thats pretty much what I decided on, but I wasn't sure if I'd have to use the API to bounce the name resolving in the Pi-hole container. Are you sure it reads in any file changes ?

Runner up for most ugly one-liner :

$ docker network ls -f driver=bridge --format '{{.Name}}' | xargs docker network inspect | jq '.[].Containers|.[]|[.IPv4Address,.Name]|@csv' |sed 's#\/16##;s#\"##g;s#\\##g;s#,# #'
172.18.0.5 miniflux-postgres
172.18.0.4 nginx
172.18.0.6 miniflux
172.18.0.3 znc
172.18.0.9 calibre
172.18.0.7 owntracks-mosquitto
172.18.0.8 owntracks
172.18.0.2 traefik

It seems marginally faster, though relies on terrible amateurish JSON munging with jq and sed.

1 Like