Static IP and DHCP Lease in dnsmasq?
2
votes
1
answer
15848
views
I'm setting up a couple of Raspberry Pi's on my router's DMZ (don't worry all the ports are closed); my router uses DNSMasq for DNS and so I added the MAC addresses; hostnames and IPs of the pi's to the dhcp static leases.
Now that said, I'm only learning to use dhcpcd; I'm used to the old way of using
/etc/networking/interfaces
to configure ip address assignment.
On the pi's themselves, I've configured them with /etc/dhcpcd.conf
as having a static ip address and pointed them at my DNSMasq DNS Server.
It seems a little strange to do this, but is it okay to do so?
This way my pi's get a DNS record (so the devices can find each other) and a static ip address; I suppose I could configure it so that it pulls the IP based on the MAC address using the dhcpcd
client.
That said I don't really know how to configure dhcpcd
to pull it's ip address from DNSMasq; I'm planning on adding additional DNS records (maybe from /etc/hosts
) for the pi's to pick up for separate nginx server blocks , so is it okay to have static IPs configured in dhcpcd
while I have static DHCP leases configured? Or is that weird and I shouldn't do that?
Asked by leeand00
(4939 rep)
Jun 7, 2020, 07:09 PM
Last activity: Jun 8, 2020, 04:32 AM
Last activity: Jun 8, 2020, 04:32 AM