Re: [Dnsmasq-discuss] Using cname to alias dhcp-host IDs
Thanks for the input, it appears that I misunderstood the man page and it's not possible to do what I want using dnsmasq. So I just finished writing my own DHCP server that does exactly what I need and nothing else using the library from github.com/insomniacslk/dhcp Remember my DHCP server is being used by strongswan for IPSec clients so there is no MAC address in play on my setup. It's entirely host name based. Anyway the custom DHCP server is working great so consider this thread resolved. On Dec 24, 2020 at 04:02:04, Bottom Post Request wrote: > On Thu, Dec 24, 2020 at 01:15:00AM -0600, Rob Townley wrote: > > > https://serverfault.com/questions/272299/dnsmasq-mapping-2-mac-addresses-to-the-same-ip-address > > > Configuring both with the same clientID. > > Specifying two MAC addresses on one line. > > > That serverfault discussion might help but not really convinced unless your > > switch knows how to handle it somehow. > > > How would arp responses work exactly? Whichever node responds quickest is > > what it would do. Probably best to set MACs to be same at BIOS and OS > > levels. > > > "Two MAC address to same IP-address" how matches that the Subject line > and even more important the original thread? > > > On Thu, Dec 24, 2020 at 12:43 AM john doe wrote: > > > On 12/23/2020 7:08 PM, Arthur Wiebe wrote: > > > > From reading the man page, and my understanding of the statement > "Only one > > > > hostname can be given in a --dhcp-host option, but aliases are > possible by > > > > using CNAMEs. (See --cname )" I've been attempting to implement this > > > > without any success so far. > > ... > > > > > > > > > > Couple of thoughts here and this assumes that DEVICE_V1 is having the > > > correct IP before fiddling with cnames: > > > > > ... > > > > > > With 'dhcp-host' as shown above, the client presenting the hostname > > > 'DEVICE_V1' should get the fixed address shown above. > > > > > > The cname option that you have, will let DNS resolve 'DEVICEV1' or > > > 'DEVICE_V2'. > > > > > > So 'host DEVICE_V1' or 'host DEVICE_V2' should show for both the IP of > > > DEVICE_V1. > > > > > > > > > - When Dnsmasq starts, is DEVICE_V1 present in the lease file? > > > > > > Cnames are only created if the hostname is known to Dnsmasq when > starting. > > > > > > > > > > > Please show the world that you understand that > you are sending a message to a large audience. > Make it possible that messages can be skipped (or even get lost) > and still be able to follow the discussion. > > Reply below the previous text. > > > Do it for your future self when you are reading this from > an archive that a websearch engine did give you. > > ___ > Dnsmasq-discuss mailing list > Dnsmasq-discuss@lists.thekelleys.org.uk > http://lists.thekelleys.org.uk/mailman/listinfo/dnsmasq-discuss > ___ Dnsmasq-discuss mailing list Dnsmasq-discuss@lists.thekelleys.org.uk http://lists.thekelleys.org.uk/mailman/listinfo/dnsmasq-discuss
Re: [Dnsmasq-discuss] Using cname to alias dhcp-host IDs
On Thu, Dec 24, 2020 at 01:15:00AM -0600, Rob Townley wrote: > https://serverfault.com/questions/272299/dnsmasq-mapping-2-mac-addresses-to-the-same-ip-address > > Configuring both with the same clientID. > Specifying two MAC addresses on one line. > > That serverfault discussion might help but not really convinced unless your > switch knows how to handle it somehow. > > How would arp responses work exactly? Whichever node responds quickest is > what it would do. Probably best to set MACs to be same at BIOS and OS > levels. "Two MAC address to same IP-address" how matches that the Subject line and even more important the original thread? > On Thu, Dec 24, 2020 at 12:43 AM john doe wrote: > > On 12/23/2020 7:08 PM, Arthur Wiebe wrote: > > > From reading the man page, and my understanding of the statement "Only > > > one > > > hostname can be given in a --dhcp-host option, but aliases are possible by > > > using CNAMEs. (See --cname )" I've been attempting to implement this > > > without any success so far. ... > > > > > > > Couple of thoughts here and this assumes that DEVICE_V1 is having the > > correct IP before fiddling with cnames: > > ... > > > > With 'dhcp-host' as shown above, the client presenting the hostname > > 'DEVICE_V1' should get the fixed address shown above. > > > > The cname option that you have, will let DNS resolve 'DEVICEV1' or > > 'DEVICE_V2'. > > > > So 'host DEVICE_V1' or 'host DEVICE_V2' should show for both the IP of > > DEVICE_V1. > > > > > > - When Dnsmasq starts, is DEVICE_V1 present in the lease file? > > > > Cnames are only created if the hostname is known to Dnsmasq when starting. > > > > Please show the world that you understand that you are sending a message to a large audience. Make it possible that messages can be skipped (or even get lost) and still be able to follow the discussion. Reply below the previous text. Do it for your future self when you are reading this from an archive that a websearch engine did give you. ___ Dnsmasq-discuss mailing list Dnsmasq-discuss@lists.thekelleys.org.uk http://lists.thekelleys.org.uk/mailman/listinfo/dnsmasq-discuss
Re: [Dnsmasq-discuss] Using cname to alias dhcp-host IDs
On Thu, Dec 24, 2020 at 07:09:28AM +0100, john doe wrote: > On 12/23/2020 7:08 PM, Arthur Wiebe wrote: > > From reading the man page, and my understanding of the statement "Only one > > hostname can be given in a --dhcp-host option, but aliases are possible by > > using CNAMEs. (See --cname )" I've been attempting to implement this > > without any success so far. > > > > My goal is to have two names get assigned the same IP via DHCP. The purpose > > of this is transitioning IPSec IDs as I have strongswan using dnsmasq to > > assign static IPs to mobile clients. > > > > In this example I would like both DEVICE_V1 and DEVICE_V2 to get the same > > IP address 10.1.2.3 and my current attempted configuration is as follows. > > > > /etc/hosts contains: > > > > 10.1.2.3 DEVICE_V1 > > > > -- > > > > dnsmasq conf file contains: > > > > cname=DEVICE_V2,DEVICE_V1 > > dhcp-host=DEVICE_V1,10.1.2.3,infinite > > > > Couple of thoughts here and this assumes that DEVICE_V1 is having the > correct IP before fiddling with cnames: > > - Does it help if you remove the line from /etc/hosts file and only use > the 'dhcp-host' statement? > > With 'dhcp-host' as shown above, the client presenting the hostname > 'DEVICE_V1' should get the fixed address shown above. > > The cname option that you have, will let DNS resolve 'DEVICEV1' or > 'DEVICE_V2'. > > So 'host DEVICE_V1' or 'host DEVICE_V2' should show for both the IP of > DEVICE_V1. Output of a DNS query command like `host` is indeed missing. I'm looking forward to see the data that comes from it. > - When Dnsmasq starts, is DEVICE_V1 present in the lease file? > > Cnames are only created if the hostname is known to Dnsmasq when starting. > > > John Doe Hey John, Thanks for making it possible to read in the discussion order. It shows that you understand timezone differences. That you know that you that people can quicker catch-up an email thread by skipping the emails that arrived while they were asleep. Regards Geert Stappers -- Silence is hard to parse ___ Dnsmasq-discuss mailing list Dnsmasq-discuss@lists.thekelleys.org.uk http://lists.thekelleys.org.uk/mailman/listinfo/dnsmasq-discuss
Re: [Dnsmasq-discuss] Using cname to alias dhcp-host IDs
https://serverfault.com/questions/272299/dnsmasq-mapping-2-mac-addresses-to-the-same-ip-address Configuring both with the same clientID. Specifying two MAC addresses on one line. That serverfault discussion might help but not really convinced unless your switch knows how to handle it somehow. How would arp responses work exactly? Whichever node responds quickest is what it would do. Probably best to set MACs to be same at BIOS and OS levels. On Thu, Dec 24, 2020 at 12:43 AM john doe wrote: > On 12/23/2020 7:08 PM, Arthur Wiebe wrote: > > From reading the man page, and my understanding of the statement "Only > one > > hostname can be given in a --dhcp-host option, but aliases are possible > by > > using CNAMEs. (See --cname )" I've been attempting to implement this > > without any success so far. > > > > My goal is to have two names get assigned the same IP via DHCP. The > purpose > > of this is transitioning IPSec IDs as I have strongswan using dnsmasq to > > assign static IPs to mobile clients. > > > > In this example I would like both DEVICE_V1 and DEVICE_V2 to get the same > > IP address 10.1.2.3 and my current attempted configuration is as follows. > > > > /etc/hosts contains: > > > > 10.1.2.3 DEVICE_V1 > > > > -- > > > > dnsmasq conf file contains: > > > > cname=DEVICE_V2,DEVICE_V1 > > dhcp-host=DEVICE_V1,10.1.2.3,infinite > > > > Couple of thoughts here and this assumes that DEVICE_V1 is having the > correct IP before fiddling with cnames: > > - Does it help if you remove the line from /etc/hosts file and only use > the 'dhcp-host' statement? > > With 'dhcp-host' as shown above, the client presenting the hostname > 'DEVICE_V1' should get the fixed address shown above. > > The cname option that you have, will let DNS resolve 'DEVICEV1' or > 'DEVICE_V2'. > > So 'host DEVICE_V1' or 'host DEVICE_V2' should show for both the IP of > DEVICE_V1. > > > - When Dnsmasq starts, is DEVICE_V1 present in the lease file? > > Cnames are only created if the hostname is known to Dnsmasq when starting. > > > -- > John Doe > > ___ > Dnsmasq-discuss mailing list > Dnsmasq-discuss@lists.thekelleys.org.uk > http://lists.thekelleys.org.uk/mailman/listinfo/dnsmasq-discuss > ___ Dnsmasq-discuss mailing list Dnsmasq-discuss@lists.thekelleys.org.uk http://lists.thekelleys.org.uk/mailman/listinfo/dnsmasq-discuss
Re: [Dnsmasq-discuss] Using cname to alias dhcp-host IDs
On 12/23/2020 7:08 PM, Arthur Wiebe wrote: From reading the man page, and my understanding of the statement "Only one hostname can be given in a --dhcp-host option, but aliases are possible by using CNAMEs. (See --cname )" I've been attempting to implement this without any success so far. My goal is to have two names get assigned the same IP via DHCP. The purpose of this is transitioning IPSec IDs as I have strongswan using dnsmasq to assign static IPs to mobile clients. In this example I would like both DEVICE_V1 and DEVICE_V2 to get the same IP address 10.1.2.3 and my current attempted configuration is as follows. /etc/hosts contains: 10.1.2.3 DEVICE_V1 -- dnsmasq conf file contains: cname=DEVICE_V2,DEVICE_V1 dhcp-host=DEVICE_V1,10.1.2.3,infinite Couple of thoughts here and this assumes that DEVICE_V1 is having the correct IP before fiddling with cnames: - Does it help if you remove the line from /etc/hosts file and only use the 'dhcp-host' statement? With 'dhcp-host' as shown above, the client presenting the hostname 'DEVICE_V1' should get the fixed address shown above. The cname option that you have, will let DNS resolve 'DEVICEV1' or 'DEVICE_V2'. So 'host DEVICE_V1' or 'host DEVICE_V2' should show for both the IP of DEVICE_V1. - When Dnsmasq starts, is DEVICE_V1 present in the lease file? Cnames are only created if the hostname is known to Dnsmasq when starting. -- John Doe ___ Dnsmasq-discuss mailing list Dnsmasq-discuss@lists.thekelleys.org.uk http://lists.thekelleys.org.uk/mailman/listinfo/dnsmasq-discuss
Re: [Dnsmasq-discuss] Using cname to alias dhcp-host IDs
Geert, I'm fully aware that a CNAME is DNS, and dhcp-host is not, but DNS and DHCP do work together in dnsmasq in various ways. This is why I quoted the statement from http://www.thekelleys.org.uk/dnsmasq/docs/dnsmasq-man.html in the dhcp-host option which specifically says to look at the documentation for --cname if you want to have an alias for a host. I'm pretty sure I'm misunderstanding some part of the documentation. Perhaps it's trying to say if you are using dhcp-host to create DNS records for a host, you can use CNAME to alias another name to it via DNS, which seems too obvious to bother mentioning, but maybe that's all it's saying. When I read that statement I understood that if you created a CNAME that the DHCP server would use it to alias the name as well, but maybe that's not the case. On Dec 23, 2020 at 16:13:45, Geert Stappers wrote: > On Wed, Dec 23, 2020 at 12:08:32PM -0600, Arthur Wiebe wrote: > > >From reading the man page, and my understanding of the statement "Only one > > hostname can be given in a --dhcp-host option, but aliases are possible by > > using CNAMEs. (See --cname )" I've been attempting to implement this > > without any success so far. > > > My goal is to have two names get assigned the same IP via DHCP. The purpose > > of this is transitioning IPSec IDs as I have strongswan using dnsmasq to > > assign static IPs to mobile clients. > > > In this example I would like both DEVICE_V1 and DEVICE_V2 to get the same > > IP address 10.1.2.3 and my current attempted configuration is as follows. > > > /etc/hosts contains: > > > 10.1.2.3 DEVICE_V1 > > > -- > > > dnsmasq conf file contains: > > > cname=DEVICE_V2,DEVICE_V1 > > dhcp-host=DEVICE_V1,10.1.2.3,infinite > > > -- > > > I've tried variations including defining both IDs in the hosts file as > > follows and adding "host-record" conf options for DEVICE_V1 but neither > > made a difference. > > 10.1.2.3 DEVICE_V1 DEVICE_V2 > > > So far no matter what I've tried only the ID specified in the dhcp-host > > option actually gets an IP. > > In the dnsmasq log I get the following message for DEVICE_V2. > > client provides name: DEVICE_V2 > > DHCPDISCOVER(eth0) 00:11:22:33:44:55 no address available > > > I'd love either some clarification on how this is supposed to work > > > [0] > > `cname` is DNS, `dhcp-host` is not DNS. > > > or perhaps this is a bug in dnsmasq 2.80? > > > http://www.catb.org/esr/faqs/smart-questions.html#idm368 > > > Regards > Geert Stappers > > [0] Not my smartest move for choosing to write an email when having no >time to write an email ... > -- > Silence is hard to parse > > ___ > Dnsmasq-discuss mailing list > Dnsmasq-discuss@lists.thekelleys.org.uk > http://lists.thekelleys.org.uk/mailman/listinfo/dnsmasq-discuss > ___ Dnsmasq-discuss mailing list Dnsmasq-discuss@lists.thekelleys.org.uk http://lists.thekelleys.org.uk/mailman/listinfo/dnsmasq-discuss
Re: [Dnsmasq-discuss] Using cname to alias dhcp-host IDs
On Wed, Dec 23, 2020 at 12:08:32PM -0600, Arthur Wiebe wrote: > >From reading the man page, and my understanding of the statement "Only one > hostname can be given in a --dhcp-host option, but aliases are possible by > using CNAMEs. (See --cname )" I've been attempting to implement this > without any success so far. > > My goal is to have two names get assigned the same IP via DHCP. The purpose > of this is transitioning IPSec IDs as I have strongswan using dnsmasq to > assign static IPs to mobile clients. > > In this example I would like both DEVICE_V1 and DEVICE_V2 to get the same > IP address 10.1.2.3 and my current attempted configuration is as follows. > > /etc/hosts contains: > > 10.1.2.3 DEVICE_V1 > > -- > > dnsmasq conf file contains: > > cname=DEVICE_V2,DEVICE_V1 > dhcp-host=DEVICE_V1,10.1.2.3,infinite > > -- > > I've tried variations including defining both IDs in the hosts file as > follows and adding "host-record" conf options for DEVICE_V1 but neither > made a difference. > 10.1.2.3 DEVICE_V1 DEVICE_V2 > > So far no matter what I've tried only the ID specified in the dhcp-host > option actually gets an IP. > In the dnsmasq log I get the following message for DEVICE_V2. > client provides name: DEVICE_V2 > DHCPDISCOVER(eth0) 00:11:22:33:44:55 no address available > > I'd love either some clarification on how this is supposed to work [0] `cname` is DNS, `dhcp-host` is not DNS. > or perhaps this is a bug in dnsmasq 2.80? http://www.catb.org/esr/faqs/smart-questions.html#idm368 Regards Geert Stappers [0] Not my smartest move for choosing to write an email when having no time to write an email ... -- Silence is hard to parse ___ Dnsmasq-discuss mailing list Dnsmasq-discuss@lists.thekelleys.org.uk http://lists.thekelleys.org.uk/mailman/listinfo/dnsmasq-discuss
[Dnsmasq-discuss] Using cname to alias dhcp-host IDs
>From reading the man page, and my understanding of the statement "Only one hostname can be given in a --dhcp-host option, but aliases are possible by using CNAMEs. (See --cname )" I've been attempting to implement this without any success so far. My goal is to have two names get assigned the same IP via DHCP. The purpose of this is transitioning IPSec IDs as I have strongswan using dnsmasq to assign static IPs to mobile clients. In this example I would like both DEVICE_V1 and DEVICE_V2 to get the same IP address 10.1.2.3 and my current attempted configuration is as follows. /etc/hosts contains: 10.1.2.3 DEVICE_V1 -- dnsmasq conf file contains: cname=DEVICE_V2,DEVICE_V1 dhcp-host=DEVICE_V1,10.1.2.3,infinite -- I've tried variations including defining both IDs in the hosts file as follows and adding "host-record" conf options for DEVICE_V1 but neither made a difference. 10.1.2.3 DEVICE_V1 DEVICE_V2 So far no matter what I've tried only the ID specified in the dhcp-host option actually gets an IP. In the dnsmasq log I get the following message for DEVICE_V2. client provides name: DEVICE_V2 DHCPDISCOVER(eth0) 00:11:22:33:44:55 no address available I'd love either some clarification on how this is supposed to work or perhaps this is a bug in dnsmasq 2.80? ___ Dnsmasq-discuss mailing list Dnsmasq-discuss@lists.thekelleys.org.uk http://lists.thekelleys.org.uk/mailman/listinfo/dnsmasq-discuss