DHCP/dnsmasq server setup for laptops with 2 MACS

Issues related to configuring your network
Post Reply
lightman47
Posts: 1522
Joined: 2014/05/21 20:16:00
Location: Central New York, USA

DHCP/dnsmasq server setup for laptops with 2 MACS

Post by lightman47 » 2014/11/29 18:55:46

I am setting up a CentOS7 server using dhcpd (with reserved addresses) and dnsmasq with the host file "lookups" for my internal network.

I am trying to get the in-house laptops - each with ONE hostname but two MAC/IPs (wired/wireless) to correctly resolve to a single hostname. That is, regardless of how it's connected, having it respond to it's single hostname . For instance, I want to PING the hostname and "hit" it regardless of it's MAC/IP.

I've tried defining "duplicate" hostnames in dhcpd.conf for the two different MACs/IPs. Understandably, it didn't like that a lot.The next temptation is to 'double-define' the laptops in the dnsmasq server's hosts (i.e. two entries/IPs for the appropriate hostnames). I haven't yet tried this because I have numerous smaller issues requiring more immediate attention.

Is what I want EASILY attainable, or should I re-think? This is NOT critical; if I can't do it then so be it.

Thank you.

aks
Posts: 3073
Joined: 2014/09/20 11:22:14

Re: DHCP/dnsmasq server setup for laptops with 2 MACS

Post by aks » 2014/12/01 17:35:06

So I'm not to sure about dnsmasq but in "normal" (i.e.: bind) DNS, you can have multiple A records (assuming IPv4) for a single address. You can also tell the bind server to return the addresses in a round robin manner - so return addr a and addr b and then on next time host is looked up return addr b addr a - ofcourse this ignores the fact that some DNS clients (resolvers) will re-order these addresses anyway.

So this isn't really an answer, but hopefully a hint to help you in your search.

lightman47
Posts: 1522
Joined: 2014/05/21 20:16:00
Location: Central New York, USA

Re: DHCP/dnsmasq server setup for laptops with 2 MACS

Post by lightman47 » 2014/12/02 15:50:25

Thanks. I was hoping it could be easily done but realized it wasn't likely. As mentioned, not a big deal. I'll just appwnd a "w" to the end it the hostname for the wireless connection. If the ping doesn't respond to one name, then I just ping the other. ;)

Post Reply