Setting up host names


#1

I’ve read through the threads here, and unfortunately the early suggestions seem like they have been deprecated by the later responses and the conversation seems to diverge. So I apologize for asking this again:

###Background of hardware, OS, installed apps and configuration:

  • SBC:Odroid C1+
  • OS: DietPi
  • PiHole (installed via DietPi)
  • PiVPN (installed via DietPi)

I use the DHCP “reserved” addressing feature of my router. So my SBC box will always get 172.16.0.65, and most other devices have similar entries.

###Why I’m using PiHole

My router does not support NAT loopback. Therefore if I want to access internal websites that are public, such as partytime.example.com I have to use a DNS server. I also have several Windows machines, not to mention my odroid which I would like to be able to access all via hostname. I also want to make some “nickname” DNS entries that are duplicate names for the same ip. Eventually, I will want to have PiHole to forward these DNS entries so my OpenVPN clients can use the hostnames as well, but that’s for another time. So here are some of my DNS entries:

127.0.0.1		odroid  	    #this SBC
172.16.0.65		sleepy			#DHCP-Assigned ip for this SBC 
172.16.0.9		scratchy		#some windows box
172.16.0.9		smelly			#another windows box
172.16.0.6		foo.example.com	#a website residing in this network.

Where do I put my DNS entries? I’ve seen several people make many different suggestions. I’ve always used /etc/hosts but I see some people think that’s a bad idea (why?). After doing this, I need to configure on http://172.16.0.65/pihole/ and make changes to the DNS section. What options should I use? Do I have to make any manual changes to any config files?

ETA: I’ve managed to get example.com entries working, but putting them in a separate file using this post. (Note, you don’t have to bother reading the rest. That post has all you need). However I’m having a problem with entries in /etc/hosts which from what I’ve read are supposed to be sucked into PiHole. For example DietPi is in that file. But I can’t ping dietpi from any client using this for DNS. However I can do the following ping dietpi. (note the ‘dot’ at the end). What am I doing wrong? BTW, I’m not going to use this as a DHCP server. No offense, but no way, no how. I keep running into products and programs that want to be my everything and that includes DHCP. I’m happy with it the way it is.


#2

This feature request,


Was resolved by this PR,

Which seems to also resolve your issue?


#3

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