My local network uses DHCP. I’m trying to set up local names and static addresses for some well-known devices.
This appears to be a bit of a morass because it seems that most of the DNS settings only apply to dnsmasq, but the main DNS resolver is kresd (this could use some UI improvements)… however, I’ve made it work:
But only by entering all the information twice: once in the DHCP static leases page, and then I have to enter all the hostname/IP information again in the Hostnames page. (All in Luci, as none of this appears configurable in Foris.)
Am I missing some way of automatically populating DNS with the information from the static leases? It would make setting up new devices far easier.
(There’s an option in Foris to do just this, but it doesn’t seem to do anything.)
Perhaps you could describe the symptom of what is not working as it is not so apparent from the post.
That should not be necessary.
Foris is not meant as a replacement for LuCI, there is a distinctive difference in the user type being served by each frontend respectively. That said it could be confusing at times in view of settings overlapping amongst the 2 frontends.
Well, the symptom is as described — I enter hostname, mac address and IP address into the DHCP configuration page, and then even though the device gets assigned the correct IP address by DHCP, DNS lookups don’t resolve the hostnames to the IP address.
If this is configuring dnsmasq only, then how could I verify that kresd is forwarding requests to dnsmasq?
I am not sure whether changing dnsmasq DHCP settings in LuCI is actually invoking a reload of the resolver or just dnsmasq (and thus missing to kick off dhcp_host_domain_ng.py)
Try from ssh cli /etc/init.d/resolver reload or /etc/init.d/resolver restart which kicks off dhcp_host_domain_ng.py
To my understanding it is not forwarding but the script is adding host files to kresd by parsing the config settings in dhcp
def refresh_leases(self):
self._clean_hints()
if self.__static_leases_enabled:
self._call_kresd("hints.add_hosts('%s')" % self.__static_leases)
if self.__dynamic_leases_enabled:
self._call_kresd("hints.add_hosts('%s')" % self.__dynamic_leases)
@anon50890781: I’ve been rebooting to make sure that any configuration changes take effect.
@RomanHK: that doesn’t do what I want it to do. I want to configure DHCP and DNS in a single place. Editing /etc/hosts (which I’ve actually also tried, along with editing /etc/ethers) will still require me to enter the hostnames and IP addresses twice.
I have to throw in the towel here as not being familiar with kresd. The script works as expected for unbound, i.e. only having entered static leases in LuCI. That was until having switched to odhcpd which is not supported by the script, but that is a different story then.
I haven’t done any customisation of my system; this is as it shipped. Is this all supposed to work out of the box? I came here from DD-WRT, where this kind of configuration is very easy.
Unfortunately, it did not work otherwise. When I have enabled DNS in Foris, a domain (lan) is required, so the result was: computer1.lan or computer2.lan
To do this all in one place, we (the users) will not do anything about it. It’s up to developers to do it.
… that dynamic script need some revision. There is another issue with format of lease files, script is complaining about it since two updates of TOS back (i did not changed anything).
Now have to use static leases for some “important” devices in my network in combination of hostname entries using Luci. And so far all of them are getting my local dns ips.
Populating DNS, … chmmm, it is a bit tricky as it is not just one place but three, to trigger it. I think i have it working with localdomain and static leases. Let me check my setup (tomorrow possibly), i will try to give more specific hints …
use custom dns servers : list-of-your-favorite-dns-servers
And in some uci configs (dhcp,resolver) i have to check and setup static/dynamic domain parameter(and value) explicitly for each configuration block/resolver.
In Foris you can choose the suffix. It doesn’t let you choose an empty one, though. In any case, I personally don’t think leaving an empty one would be a good idea.
For me the names from DHCP just work out of the box, after clicking that single checkbox in Foris.