[Dnsmasq-discuss] dhcp-host=hostnameonly does not work

john doe johndoe65534 at mail.com
Fri May 20 08:08:28 UTC 2022


On 5/19/2022 11:42 PM, Maulis Adam wrote:
>
>
> On 5/19/22 21:22, john doe wrote:
>> On 5/19/2022 4:46 PM, Maulis Adam via Dnsmasq-discuss wrote:
>>> Hello,
>>>
>>> I like to configure my dhcp server with as little redundacy as possible.
>>> But it looks like the IP address needs to be written both of /etc/hosts
>>> and /etc/dnsmasq.conf
>>>
>>> The client machines are in the /etc/hosts for example:
>>>
>>> 192.168.64.200 cntemplate.hpc
>>>
>>> The non-default dnsmasq config options are:
>>>
>>> no-resolv
>>> server=192.168.5.251
>>> expand-hosts
>>> domain=hpc
>>>
>>> Case 1:
>>> dhcp-range=192.168.64.0,static
>>> dhcp-host=cntemplate
>>>
>>> Does not work, syslog said:
>>> May 19 15:53:47 gw00 dnsmasq-dhcp[4912]: DHCPDISCOVER(vlan164)
>>> 02:00:00:00:00:65 no address available
>>>
>>> Case 2:
>>> dhcp-range=192.168.64.0,static
>>> dhcp-host=cntemplate,192.168.64.200
>>>
>>> Working, but needed a duplicate entry both of /etc/hosts and
>>> /etc/dnsmasq.conf
>>>
>>> Case 3:
>>> dhcp-range=192.168.64.100,192.168.64.250
>>> dhcp-host=cntemplate,192.168.64.200
>>>
>>> Working, but needed a duplicate entry both of /etc/hosts and
>>> /etc/dnsmasq.conf
>>>
>>> Case 4:
>>> dhcp-range=192.168.64.100,192.168.64.250
>>> dhcp-host=cntemplate
>>>
>>
>> I might be missing something here but why do you use the option
>> 'dhcp-host' if you specify the hostname in '/etc/hosts'?
>>
>> --
>> John Doe
>>
>
> Thank you for your answer.
> I thought that "dhcp-host" option is mandatory for fixed dhcp IPs.
>
> Case 5:
> dhcp-range=192.168.64.0,static
> # no dhcp-host
>
> Not working:
> dnsmasq-dhcp[5505]: DHCPDISCOVER(vlan164) 02:00:00:00:00:65 no address
> available
>
> Case 6:
> dhcp-range=192.168.64.0,static
> # no dhcp-host
>
> Not working:
> dnsmasq-dhcp[5533]: not giving name cntemplate.hpc to the DHCP lease of
> 192.168.64.215 because the name exists in /etc/hosts with address
> 192.168.64.200
>

The IPs are not the same, try to remove this lease in the lease file.

--
John Doe



More information about the Dnsmasq-discuss mailing list