Can I resolve 2 websites, on 2 IPs on same Pi as Pihole?

I'm new to PiHole, it's working great.

I thought Pihole(dnsmasq) could help me route 2 ddns domains to 2 IPs on PiHole setup on eth0 and eth0:1, one hosting site via nginx, the other apache. It's a long story WHY but I can't use nginx to reverse proxy.

Inside my LAN both websites work, outside they resolve only to a.ddns.net.

I created /etc/pihole/lan.list based on /etc/hosts
192.168.1.173 a.ddns.net raspberrypi3
192.168.1.174 b.ddns.net raspberrypi3

and restarted pihole dns

Is it possible to resolve FQDN to 2 IP on same server as pihole ?

Expected Behaviour:

When I curl a.ddns.net outside my LAN I expected it to be directed via PiHole DNS to 192.168.1.174 using nginx on port 80/443.
Same for b.ddns.net -> 192.168.1.173 apache 80/443

Actual Behaviour:

I see local.list doesn't add my lan.list nor what is in /etc/hosts

curl https://b.ddns.net resolves to a.ddns.net and triggers SSL false cert.

I notice in creating debug log that only one IP4 address is in setupvars,

Debug Token:

https://tricorder.pi-hole.net/tn6y6uorx8

Thanks for any guidance.

What do you mean with outside ?

pi@noads:~ $ cat /etc/hosts
127.0.0.1       localhost
::1             localhost ip6-localhost ip6-loopback
ff02::1         ip6-allnodes
ff02::2         ip6-allrouters

127.0.1.1       noads.dehakkelaar.nl

0.0.0.0 wpad wpad.dehakkelaar.nl
:: wpad wpad.dehakkelaar.nl

192.168.1.173 a.ddns.net
192.168.1.174 b.ddns.net

pi@noads:~ $ sudo service pihole-FTL reload
pi@noads:~ $

From a client:

C:\>nslookup a.ddns.net
Server:  noads.dehakkelaar.nl
Address:  10.0.0.2

Name:    a.ddns.net
Address:  192.168.1.173

C:\>nslookup b.ddns.net
Server:  noads.dehakkelaar.nl
Address:  10.0.0.2

Name:    b.ddns.net
Address:  192.168.1.174

Better not touch local.list and see below:

If select below option, the IP and interface in setupvars doesnt matter:

image

Thanks deHakkelar.

So, if I understand correctly, it is possible to do this.

I meant 'outside' my LAN since my intent is to make both website available outside my LAN.

I deleted lan-list and reloaded pihole FTL and now I get similar nslookup to you on LAN client.

Outside my LAN curl on both sites looks better but I get SSL cert mismatch. I'll play with the setting a bit more to see if I can get the final step done.

This topic was automatically closed 21 days after the last reply. New replies are no longer allowed.