Jump to content

Pi-Hole as LAN DNS for custom Hostnames

Hello there,

 

I need help using pi hole for making custom hostnames for lan PCs and VM.I have a lot of stuff in VMs,2 openwrt aps and a couple of server... How can i set it up because i know pi hole as DNS can make this possible.Example 192.16.0.11→pc.local...Please make so that a stupid person like me can understand it

NOTE!!

I know i should be able to add this into /etc/hosts which works exactly half of times and takes a long time to respond...

Short ping session↓

Spoiler

C:\Windows\system32>ping pc.local -t

Pinging pc.local [192.168.0.11] with 32 bytes of data:
Request timed out.
Reply from 192.168.0.11: bytes=32 time<1ms TTL=128
Reply from 192.168.0.11: bytes=32 time<1ms TTL=128
Reply from 192.168.0.11: bytes=32 time<1ms TTL=128
Request timed out.
Reply from 192.168.0.11: bytes=32 time<1ms TTL=128
Reply from 192.168.0.11: bytes=32 time<1ms TTL=128
Request timed out.
Request timed out.
Request timed out.
Request timed out.
Reply from 192.168.0.11: bytes=32 time<1ms TTL=128
Reply from 192.168.0.11: bytes=32 time<1ms TTL=128
Reply from 192.168.0.11: bytes=32 time<1ms TTL=128
Reply from 192.168.0.11: bytes=32 time<1ms TTL=128
Reply from 192.168.0.11: bytes=32 time<1ms TTL=128
Reply from 192.168.0.11: bytes=32 time<1ms TTL=128
Reply from 192.168.0.11: bytes=32 time<1ms TTL=128
Reply from 192.168.0.11: bytes=32 time<1ms TTL=128
Request timed out.
Request timed out.
Request timed out.
Request timed out.
Reply from 192.168.0.11: bytes=32 time<1ms TTL=128
Request timed out.
Request timed out.


Ping statistics for 192.168.0.11:
Packets: Sent = 26, Received = 14, Lost = 12 (46% loss),
Approximate round trip times in milli-seconds:
Minimum = 0ms, Maximum = 0ms, Average = 0ms

you can see this is the problem and i want it to work perfectly so i can stop using and getting confused by plain ips.PLEASE HELP!!

Link to comment
Share on other sites

Link to post
Share on other sites

22 minutes ago, YouDontHaveToKnow said:

Hello there,

 

I need help using pi hole for making custom hostnames for lan PCs and VM.I have a lot of stuff in VMs,2 openwrt aps and a couple of server... How can i set it up because i know pi hole as DNS can make this possible.Example 192.16.0.11→pc.local...Please make so that a stupid person like me can understand it

NOTE!!

I know i should be able to add this into /etc/hosts which works exactly half of times and takes a long time to respond...

Short ping session↓

  Hide contents

C:\Windows\system32>ping pc.local -t

Pinging pc.local [192.168.0.11] with 32 bytes of data:
Request timed out.
Reply from 192.168.0.11: bytes=32 time<1ms TTL=128
Reply from 192.168.0.11: bytes=32 time<1ms TTL=128
Reply from 192.168.0.11: bytes=32 time<1ms TTL=128
Request timed out.
Reply from 192.168.0.11: bytes=32 time<1ms TTL=128
Reply from 192.168.0.11: bytes=32 time<1ms TTL=128
Request timed out.
Request timed out.
Request timed out.
Request timed out.
Reply from 192.168.0.11: bytes=32 time<1ms TTL=128
Reply from 192.168.0.11: bytes=32 time<1ms TTL=128
Reply from 192.168.0.11: bytes=32 time<1ms TTL=128
Reply from 192.168.0.11: bytes=32 time<1ms TTL=128
Reply from 192.168.0.11: bytes=32 time<1ms TTL=128
Reply from 192.168.0.11: bytes=32 time<1ms TTL=128
Reply from 192.168.0.11: bytes=32 time<1ms TTL=128
Reply from 192.168.0.11: bytes=32 time<1ms TTL=128
Request timed out.
Request timed out.
Request timed out.
Request timed out.
Reply from 192.168.0.11: bytes=32 time<1ms TTL=128
Request timed out.
Request timed out.


Ping statistics for 192.168.0.11:
Packets: Sent = 26, Received = 14, Lost = 12 (46% loss),
Approximate round trip times in milli-seconds:
Minimum = 0ms, Maximum = 0ms, Average = 0ms

 

you can see this is the problem and i want it to work perfectly so i can stop using and getting confused by plain ips.PLEASE HELP!!

I can’t answer in relation to doing this with pihole, but how your computer resolves the IP should have nothing to do with pinging it. You can see at the start of the ping process, it first determines the IP, and from that point onwards the process uses that IP - it never looks up the hostname again.

 

to test this, run these at the same time in different windows:

ping pc.local -t

ping 192.168.0.11 -t

 

and I’m sure you will get the same packet loss in both at the same time.

 

Based on the pattern you are seeing in the ping responses, I would suspect either 

a) a loop in your network

b) two devices both using the IP 192.168.0.11 (an IP conflict)

Looking to buy GTX690, other multi-GPU cards, or single-slot graphics cards: 

 

Link to comment
Share on other sites

Link to post
Share on other sites

13 minutes ago, Electronics Wizardy said:

Do you get the same ping isue if you just ping the ip, normally if you have pings dropping its not dns.

it seams when i ping localhost,192.168.0.11 or pc.local from the server it works fine but trying to ping from any other pc it behaves the way i describe

Link to comment
Share on other sites

Link to post
Share on other sites

15 minutes ago, brwainer said:

I can’t answer in relation to doing this with pihole, but how your computer resolves the IP should have nothing to do with pinging it. You can see at the start of the ping process, it first determines the IP, and from that point onwards the process uses that IP - it never looks up the hostname again.

 

to test this, run these at the same time in different windows:

ping pc.local -t

ping 192.168.0.11 -t

 

and I’m sure you will get the same packet loss in both at the same time.

 

Based on the pattern you are seeing in the ping responses, I would suspect either 

a) a loop in your network

b) two devices both using the IP 192.168.0.11 (an IP conflict)

b) definetlly not i know something about networking

a)how would i check?

Link to comment
Share on other sites

Link to post
Share on other sites

1 minute ago, YouDontHaveToKnow said:

it seams when i ping localhost,192.168.0.11 or pc.local from the server it works fine but trying to ping from any other pc it behaves the way i describe

Then its probably not dns, and probably something else on the network.

 

Whats your network layout? How are you connected. Try different cables

 

Link to comment
Share on other sites

Link to post
Share on other sites

2 minutes ago, Electronics Wizardy said:

Then its probably not dns, and probably something else on the network.

 

Whats your network layout? How are you connected. Try different cables

they are both straight to router with the same cable for years

i mean beafore the pihole it all worked fine

Link to comment
Share on other sites

Link to post
Share on other sites

1 minute ago, YouDontHaveToKnow said:

i mean beafore the pihole it all worked fine

if you remove pihole, can you ping normally again?

 

Link to comment
Share on other sites

Link to post
Share on other sites

3 minutes ago, Electronics Wizardy said:

if you remove pihole, can you ping normally again?

 

actually no

Link to comment
Share on other sites

Link to post
Share on other sites

8 minutes ago, YouDontHaveToKnow said:

actually no

what is your network setup? Try different cables? What switch? Can you ping from switch without error?

 

Link to comment
Share on other sites

Link to post
Share on other sites

1 minute ago, Electronics Wizardy said:

what is your network setup? Try different cables? What switch? Can you ping from switch without error?

 

They both go to the sam routher with a short CAT 6 cable...Well never beafore have i just pinged it for no reason so it could have been messd up science forever?

Link to comment
Share on other sites

Link to post
Share on other sites

Just now, YouDontHaveToKnow said:

They both go to the sam routher with a short CAT 6 cable...Well never beafore have i just pinged it for no reason so it could have been messd up science forever?

i have tried to ping another pc boom worked prefectly 0 packet drops

Link to comment
Share on other sites

Link to post
Share on other sites

Just now, YouDontHaveToKnow said:

i have tried to ping another pc boom worked prefectly 0 packet drops

i will try to reboot the other pc because its my main torrent downloader so it works 24/7

Link to comment
Share on other sites

Link to post
Share on other sites

3 minutes ago, YouDontHaveToKnow said:

i will try to reboot the other pc because its my main torrent downloader so it works 24/7

it works afer reboot let me introduce pihole to my network family again

Link to comment
Share on other sites

Link to post
Share on other sites

6 minutes ago, YouDontHaveToKnow said:

it works afer reboot let me introduce pihole to my network family again

it now dosent want to ping pc or pc.local here is my /etc/hosts file:

127.0.0.1       localhost
::1             localhost ip6-localhost ip6-loopback
ff02::1         ip6-allnodes
ff02::2         ip6-allrouters

127.0.1.1       home 
192.168.0.11    pc

other pople say this setup should work but for me it dosent

on my windows server(the pc.local pc) and my windows laptop(the ping machine) are both configured with 192.168.0.16 primary dns(pihole,static) and 192.168.0.1 secindary(my router)

could it be because i have to setup dns on every device because my router disent support ustom DNS,also ad blocking with this setup works perefetly

Link to comment
Share on other sites

Link to post
Share on other sites

57 minutes ago, YouDontHaveToKnow said:

it now dosent want to ping pc or pc.local here is my /etc/hosts file:


127.0.0.1       localhost
::1             localhost ip6-localhost ip6-loopback
ff02::1         ip6-allnodes
ff02::2         ip6-allrouters

127.0.1.1       home 
192.168.0.11    pc

other pople say this setup should work but for me it dosent

on my windows server(the pc.local pc) and my windows laptop(the ping machine) are both configured with 192.168.0.16 primary dns(pihole,static) and 192.168.0.1 secindary(my router)

could it be because i have to setup dns on every device because my router disent support ustom DNS,also ad blocking with this setup works perefetly

You can setup your own dhcp server if you want to set your own dns.

 

Do the pings work now?

if the pings are failing, its not your pihole, its something else with the network.

 

Can you show a network diagram?

 

Link to comment
Share on other sites

Link to post
Share on other sites

8 hours ago, Electronics Wizardy said:

You can setup your own dhcp server if you want to set your own dns.

 

Do the pings work now?

if the pings are failing, its not your pihole, its something else with the network.

 

Can you show a network diagram?

 

I was sleeping so sorry here is the Paint diagram(dont cringe)

 

Network Diagram.png

Link to comment
Share on other sites

Link to post
Share on other sites

9 hours ago, YouDontHaveToKnow said:

I was sleeping so sorry here is the Paint diagram(dont cringe)

 

Network Diagram.png

What 2 systems are pinging?

 

Try directly connecting the systems with a cable, does the issue persist?

Link to comment
Share on other sites

Link to post
Share on other sites

sorry for late reply...After forking around i just found the easist way to get it to work is if I setup pihole as DNS and DHCP because i cant change the dns server on my router.Now it works perfectly. instant hostname lookup and  <1ms for ping

Link to comment
Share on other sites

Link to post
Share on other sites

1 hour ago, Electronics Wizardy said:

What 2 systems are pinging?

 

Try directly connecting the systems with a cable, does the issue persist?

Two system were the win server and my laptop.Now that i have learned i think when i changed the DNS manually it didnt pick up my changes right away after disabling my routers DHCP and setting pihole as dhcp server and rebooting every device.All of them picked up the new confings and with ipconfig/all they all used the piholes Ip as DNS.I am using 1.1.1.1 as the upstream dns on pihole

Link to comment
Share on other sites

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×