# How to get IPs/hostname from clients from different network(s)?

**URL:** <https://discourse.pi-hole.net/t/how-to-get-ips-hostname-from-clients-from-different-network-s/43577>\
**Category:** Community Help\
**Created:** [January 25, 2021, 3:57pm UTC](https://discourse.pi-hole.net/t/how-to-get-ips-hostname-from-clients-from-different-network-s/43577 "2021-01-25T15:57:06Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![Thomas\_Merz](https://discourse-cdn.pi-hole.net/user_avatar/discourse.pi-hole.net/thomas_merz/32/21384_2.png) [@Thomas\_Merz](https://discourse.pi-hole.net/u/Thomas_Merz)\
**Post date:** [January 25, 2021, 3:57pm UTC](https://discourse.pi-hole.net/t/how-to-get-ips-hostname-from-clients-from-different-network-s/43577/1 "2021-01-25T15:57:07Z")

</div>

Does anyone has an idea, how to get/identify/resolve clients from different networks in pihole?

```auto
192.168.0.0/24 is my DMZ network for IoT and non-personal machines
192.168.42.0/24 is my client network behind DMZ network with personal machines/devices
192.168.0.13 is DNS for both networks which port-forwards to...
192.168.42.241 is running pihole which is reached by port forwarding 0.13:53 -> 42.241:53

```

Therefore all top-clients in private 192.168.42.0/24 network are 192.168.0.13 or 192.168.0.\* (DMZ-machines, IoT, ...) but never the real 192.168.42.0.\* clients in my client network ☹

## Expected Behaviour:

192.168.42.\* clients can be identified with their 42-IP and not the IP from 0.13-forwarding-IP.

## Actual Behaviour:

192.168.42.\* clients are identified as the IP 0.13 (my forwarding-IP).

---

<div class="post-metadata">

**Author:** ![yubiuser](https://discourse-cdn.pi-hole.net/user_avatar/discourse.pi-hole.net/yubiuser/32/12100_2.png) [@yubiuser](https://discourse.pi-hole.net/u/yubiuser)\
**Post date:** [January 25, 2021, 6:48pm UTC](https://discourse.pi-hole.net/t/how-to-get-ips-hostname-from-clients-from-different-network-s/43577/2 "2021-01-25T18:48:07Z")

</div>

What do you use as router? You might be able to use EDNS(O)

> [@Support for add-subnet option from dnsmasq (ECS/EDNS0 Client Subnet)](https://discourse.pi-hole.net/t/support-for-add-subnet-option-from-dnsmasq-ecs-edns0-client-subnet/35940/1):
>
> The ask: Add support within FTLDNS for parsing the IP address/subnet passed from another dnsmasq client via add-subnet=32,128 and potentially add-mac. Asking that FTLDNS support parsing of ECS (EDNS0 Client Subnet) data from an inbound query on the requesting side. The reasoning: I have an OpenWrt router running dnsmasq for my three client subnets. It forwards queries to my Pi-hole server, which is running on a separate VM. Traditionally, the recommendation by many in the Pi-hole community is …

In general, there might be not much chance with this setup, as all queries from the different subnets appear for pihole as if they would come from 0.13-forwarding-IP (which they are, from an IP view).

You might need to change your setup and assign IPs for each subnet to your Pi-hole device. Something like  
[https://ostechnix.com/how-to-assign-multiple-ip-addresses-to-single-network-card-in-linux/](https://ostechnix.com/how-to-assign-multiple-ip-addresses-to-single-network-card-in-linux/)

---

<div class="post-metadata">

**Author:** ![deHakkelaar](https://discourse-cdn.pi-hole.net/user_avatar/discourse.pi-hole.net/dehakkelaar/32/674_2.png) [@deHakkelaar](https://discourse.pi-hole.net/u/deHakkelaar)\
**Post date:** [January 25, 2021, 8:24pm UTC](https://discourse.pi-hole.net/t/how-to-get-ips-hostname-from-clients-from-different-network-s/43577/3 "2021-01-25T20:24:33Z")

</div>

> [@yubiuser](#):
>
> You might need to change your setup and assign IPs for each subnet to your Pi-hole device. Something like
> 
> ### [Assign multiple IP addresses to single Network card in Linux](https://ostechnix.com/how-to-assign-multiple-ip-addresses-to-single-network-card-in-linux/)
> 
> This comprehensive tutorial describes how to assign multiple IP addresses to single Network card in Linux operating systems.
> 
> Est. reading time: 9 minutes

Above guide configures IP's in `/etc/network/interfaces` that most likely will conflict with `dhcpcd5` thats installed:

```auto
pi@ph5:~ $ journalctl -u dhcpcd
[..]
Jan 25 21:20:34 ph5 dhcpcd[7767]: eth0: using static address 10.0.0.4/24
Jan 25 21:20:34 ph5 dhcpcd[7767]: eth0: adding route to 10.0.0.0/24
Jan 25 21:20:34 ph5 dhcpcd[7767]: eth0: adding default route via 10.0.0.1
[..]

```

Below better to assign multiple IP's to a single interface:

> [@Pi-Hole VLAN advice using 05-custom.conf or define VLAN interfaces](https://discourse.pi-hole.net/t/pi-hole-vlan-advice-using-05-custom-conf-or-define-vlan-interfaces/38982/3):
>
> Vlan's are a switch thing. Clients and servers dont need to be aware what vlan's they are in. They only need to be aware of the subnets. There are some exceptions like hypervisors that apply virtual bridges etc for their guests/VM's that need to be in vlan trunks. I could be wrong missing some bits but am sure someone here will correct me wink To prevent having to route traffic between the subnets, you could assign all appropriate vlan's to the switch/router port that Pi-hole is connected…

---

<div class="post-metadata">

**Author:** ![Thomas\_Merz](https://discourse-cdn.pi-hole.net/user_avatar/discourse.pi-hole.net/thomas_merz/32/21384_2.png) [@Thomas\_Merz](https://discourse.pi-hole.net/u/Thomas_Merz)\
**Post date:** [January 25, 2021, 11:01pm UTC](https://discourse.pi-hole.net/t/how-to-get-ips-hostname-from-clients-from-different-network-s/43577/4 "2021-01-25T23:01:44Z")

</div>

@yubiuser : My Router is a TP-Link AX6000.

It seems to me, that my setup is a little bit too "exotic":  
Pihole is running in a Docker Container on my OpenSUSE Linux which is located in my private (42) network. I don't want to have it completely or another IP in my DMZ (0) network ☹ 🤔

---

<div class="post-metadata">

**Author:** ![yubiuser](https://discourse-cdn.pi-hole.net/user_avatar/discourse.pi-hole.net/yubiuser/32/12100_2.png) [@yubiuser](https://discourse.pi-hole.net/u/yubiuser)\
**Post date:** [January 26, 2021, 10:52am UTC](https://discourse.pi-hole.net/t/how-to-get-ips-hostname-from-clients-from-different-network-s/43577/5 "2021-01-26T10:52:52Z")

</div>

Thanks! Was just a quick googling for multiple IPs per interface.

---

<div class="post-metadata">

**Author:** ![yubiuser](https://discourse-cdn.pi-hole.net/user_avatar/discourse.pi-hole.net/yubiuser/32/12100_2.png) [@yubiuser](https://discourse.pi-hole.net/u/yubiuser)\
**Post date:** [January 26, 2021, 10:54am UTC](https://discourse.pi-hole.net/t/how-to-get-ips-hostname-from-clients-from-different-network-s/43577/6 "2021-01-26T10:54:26Z")

</div>

> [@Thomas\_Merz](#):
>
> TP-Link AX6000.

I don't thing you can configure EDNS on that router.

* * *

The only other way I see then is: get a Pi-hole for each subnet.

---

<div class="post-metadata">

**Author:** ![system](https://discourse.pi-hole.net/uploads/default/original/3X/7/c/7c8792f649eeb921c5d2b4c41564ffa873d9a2b8.png) [@system](https://discourse.pi-hole.net/u/system)\
**Post date:** [February 16, 2021, 10:54am UTC](https://discourse.pi-hole.net/t/how-to-get-ips-hostname-from-clients-from-different-network-s/43577/7 "2021-02-16T10:54:27Z")

</div>

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