How to change broadcasted DNS IP address in DHCP (v6)

Hi,

The ServerIP environment variable has been removed in v6. Now I can't change the IP address of pihole server in DHCP. I need it because I run my pihole as a Docker container with a bridge network. In v5, I could specify the custom ServerIP and it will appear in the configuration of all clients. Now in v6, it broadcasts only the internal IP address (in my case it is 172.31.x.x).

Is there any option to fix it?

Thanks.

1 Like

Hi, I'm not sure you're having the same problem as I was but it's worth a try!
I was setting two DNS servers (two piholes) using dnsmasq.d config file and the way to do it now is to add the lines here: Settings > All Settings > Misc > misc.dnsmasq_lines
What I had to write was dhcp-option=option:dns-server,192.168.0.99,192.168.0.77 (2 adresses because 2 piholes)
You should try with your ServerIP so it should look like dhcp-option=option:dns-server,192.168.0.99 (replace 192.168.0.99 with your ServerIP)

Any specific reason you are not using MACVLAN ??

It would give you a LAN IP Address for each Docker Container :wink:

I think what you want is to change the FTL option: dns.reply.host.IPv4

Every FTL option can be converted into a environment variable following this rules:

  • Start with FTLCONF_;
  • take the option and replace every dot with an underscore (_);

The result will be: FTLCONF_dns_reply_host_IPv4.


Just a note:

Please read the entire v6 README file.

You were using ServerIP, but this variable was removed many years ago and replaced with FTLCONF_LOCAL_IPV4.

Now, every variable was changed again. Reading the file will solve many small issues.

Thanks, everyone for the ideas. I decided to go with macvlan because other options don't work for me.

1 Like

@ExplodingKitten How did you get macvlan to work? I've tried a ton of different configs and can't get the pihole container exposed on its own IP address :confused:

The "readme file" link here doesn't go anywhere useful

Here is a part of my docker-compose.yml:

services:
  pihole:
    image: pihole/pihole:latest
    networks:
      default:
        ipv4_address: '192.168.31.2'
    # other options

networks:
  default:
    driver: macvlan
    driver_opts:
      parent: end0
    ipam:
      config:
        - subnet: '192.168.31.0/24'
          gateway: '192.168.31.1'

where

  • parent: end0 - the name of network interface
  • subnet - subnetwork assigned by my router
  • gateway - IP address of router
  • ipv4_address: '192.168.31.2' - is not required but allows to pin specific address to the pihole container
1 Like

and this actually exposed your pihole as IP 31.2 on your LAN? doesn't work here :frowning:

Got it working, my Synology has both eth0 and ovs_eth0 interfaces; the first one isn't bound to an IP, the second one is. Had to use that interface name.