Freekers / automated-pihole

Automated Self-Updating (Public) Pi-hole Stack using unbound as recursive DNS server with Ansible
https://public-pihole.com
GNU General Public License v3.0
60 stars 10 forks source link

how can this hostname be changed? its the same across all installs currently #7

Closed sudogreg closed 4 years ago

sudogreg commented 5 years ago

all cached queries are pulling from - unbound.automatedpihole_pihole_net

and would like to try and show the actual hostname of the server

Freekers commented 5 years ago

Try the following; edit the docker-compose.yml by hand and add hostname: your_hostname under the unbound services directive. I.e.:

  unbound:
   image: secns/unbound:latest
   restart: always
   container_name: unbound
   hostname: your_hostname
   environment:
    - DO_IPV6=no
    - HIDE_VERSION=yes
   volumes:
    - /opt/automated-pihole/unbound/pi-hole.conf:/etc/unbound/unbound.conf.d/pi-hole.conf
    - /opt/automated-pihole/unbound/root.hints:/var/lib/unbound/root.hints
   networks:
      pihole_net:
        ipv4_address: 10.0.0.2
sudogreg commented 5 years ago

did exactly that using a fresh server install and its still showing unbound.automatedpihole_pihole_net in that field on the pihole dashboard.

sudogreg commented 5 years ago

now aftera reboot it shows 10.0.0.2 for a few minutes then goes back to dns name (all on the main pihole dashboard) i can attach pics if needed

Freekers commented 5 years ago

Ah, I now see what you mean. You're referring to the network name. Unbound is the container name of unbound (happy little coincidence) and automatedpihole_pihole_net is the default network name, setup by Compose.

You can override the network name with the COMPOSE_PROJECT_NAME environment variable in your docker-compose.yml (located in /opt/automated-pihole). For more info, check: https://docs.docker.com/compose/reference/envvars/

sudogreg commented 5 years ago

i have to admit - this is perfect for DNS for my small rural wisp - i am a network guy, not so much with docker - but if there is a way to change the name using the .env file (i did try, many times, even broke it once) i would really appreciate when you have time a little more guidance. i will keep trying, and if i get it i will post again. thank you

Freekers commented 4 years ago

Closing, as there has been no activity on this issue for almost a year.