Difference between Hostnames and DHCP hostnames

Hey guys,

I am pretty new to the whole "setup your own router that can do pretty much everything". Whilst configuring I stumbled upon some (for me) weird settings: I can set hostnames via (1) "Network" -> "Hostnames" and via static IPs under (2) " DHCP and DNS" -> "Static Leases".

For me there seems not to be any difference if I enter something in (1) when having configured static IPs (my machines are reachable via their names configured in (2)). So what is the difference? When do I need to choose what option? I could not find any information in the wiki looking for "hostname". I am pretty solid in Linux and stuff but networking is a topic I did never wet my feet with so please explain to me like I am 5.

Thanks

1 Like

Sure thing. Is there a grown-up around? :wink:

Joking aside, the two functions are related, but do slightly different things.

One sets up a DNS record. If you ping a hostname, if there's a DNS entry for it then it will resolve to an IP address. This works whether or not DHCP is active on your network.

The other sets up a DHCP reservation. Every time the target device joins the network it will get the same IP address from the DHCP server. In addition, dnsmasq will also create a DNS record for each device with a DHCP reservation. Kind of a two-for-one deal.

The man page for dnsmasq at kelleys.org.uk explains everything that dnsmasq can do, in much greater detail. It's a very flexible, powerful piece of software.

3 Likes

So if I understand you correctly I could configure some hostname via (1) and point it to an arbitrary IP of my liking (i.e. even a server outside my network). Whilst (2) does configure a static IP for my local device and attaches a hostname to it? I will checkout your link (which does not work btw.) and see if I can get a hang of it.

1 Like

Yes.

Yes.

Blame the forum. I didn't create the link, the forum did. I just typed the domain name without any formatting. If you search for "dnsmasq" and "kelleys" you'll find the page anyway.

Great thanks for your help :slight_smile:

1 Like

You're welcome!

1 Like

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