This situation should be supported and working. But if those hosts do
not use DHCP to "activate" those names, you have to use different option
for them. Use --host-record instead, like:
dhcp-host=192.168.10.203,mediapi
host-record=proxy,192.168.10.61
I think dhcp-host does not care for the order of name or IP. You can
swap them to have single way defining them:
dhcp-host=mediapi,192.168.10.203
Not sure host-record does not care for the order of addresses and name.
dhcp-host is not resolvable until that address is assigned. That is by
design. If you need name to have static address, then host-record or
/etc/hosts is the way to go.
Cheers,
Petr
On 16. 06. 23 20:32, michalk via Dnsmasq-discuss wrote:
I am wanting to keep all of my configuration in the dnsmasq.conf file,
therefor am not maintaining a separate hosts file.
For some machines that are not running a DHCP client, and therefore
never request an IP lease, those machines will not be returned when
dnsmasq is asked for name resolution.
In this example, "proxy" is a DHCP client machine, and "routerpi" is a
static IP machine with no DHCP client installed.
root@routerpi:/etc# nslookup proxy
Server: 127.0.0.1
Address: 127.0.0.1#53
Non-authoritative answer:
*** Can't find proxy: No answer
root@routerpi:/etc# nslookup mediapi
Server: 127.0.0.1
Address: 127.0.0.1#53
Name: mediapi
Address: 192.168.10.203
The entries in dnsmasq look like this:
dhcp-host=192.168.10.203,mediapi
dhcp-host=192.168.10.61,proxy
I have also tried the format that includes MAC addresses, but the
result is the same:
# dhcp-host=dc:a6:32:4f:ce:4e,192.168.10.203,mediapi
And the log file contains:
dnsmasq: 147 127.0.0.1/53500 query[A] mediapi from 127.0.0.1
dnsmasq: 147 127.0.0.1/53500 DHCP mediapi is 192.168.10.203
dnsmasq: 171 127.0.0.1/56905 query[A] proxy from 127.0.0.1
dnsmasq: 171 127.0.0.1/56905 config proxy is NODATA-IPv4
How do I get the static IP hosts to be resolved?
This used to work, and I'm not sure what's changed.
--
Petr Menšík
Software Engineer, RHEL
Red Hat, http://www.redhat.com/
PGP: DFCF908DB7C87E8E529925BC4931CA5B6C9FC5CB
_______________________________________________
Dnsmasq-discuss mailing list
Dnsmasq-discuss@lists.thekelleys.org.uk
https://lists.thekelleys.org.uk/cgi-bin/mailman/listinfo/dnsmasq-discuss