Discussion:
[Dnsmasq-discuss] cnames and dns working when ip not assigned
Spike
2017-08-14 22:27:15 UTC
Permalink
Dear all,

two things I'm trying to figure out:

#CNames
how can I implement cnames in dnsmasq? I have static per mac assignments in
my hosts file and I'd like to add one or more cnames per host. Is that
possible, what's the syntax? I've seen some pages discussing the topic, but
none of the solutions worked for me and more importantly none of them was
specifying more than one cname.

#DNS while host is down
As far as I can see dnsmasq will respond to a host request only if the host
is alive/got a dhcp. Is it possible to override this behavior? If I have a
host definition with an ip, I need that to resolve even if the host is down.

thanks,

Spike
Michael
2017-08-17 16:38:17 UTC
Permalink
Post by Spike
Dear all,
#CNames
how can I implement cnames in dnsmasq? I have static per mac
assignments in my hosts file and I'd like to add one or more cnames
per host. Is that possible, what's the syntax? I've seen some pages
discussing the topic, but none of the solutions worked for me and more
importantly none of them was specifying more than one cname.
#DNS while host is down
As far as I can see dnsmasq will respond to a host request only if the
host is alive/got a dhcp. Is it possible to override this behavior? If
I have a host definition with an ip, I need that to resolve even if
the host is down.
I think they key is to realize dnsmasq is a tool with multiple jobs:
1) DNS
2) DHCP
3) tftp
4) etc

These jobs can all be interconnected easily within dnsmasq.

Static host for DNS - add to /etc/hosts or specify an alternate (or
additional ) host file w/ addn-hosts=<file> directive.

My host looks like:

192.168.1.10 hosta www aliasb aliasc
192.168.1.11 hostb
192.168.1.12 hostc

These entries are permanent and have no dependency on these hosts having
a dhcp lease. www, aliasb, and aliasc are now "aliases" for hosta, but
they are A records and not CNAMES. Do you really require a CNAME or
will A record suffice?

you can then statically define DHCP clients if you choose such as:

dhcp-host=00:90:a9:f1:b3:e7,hostf

dnsmasq will now provide a dhcp lease to this host. If hostf is in
your hosts file, it will give it that static IP. If it isnt', it will
give you an IP from the dhcp range AND dynamically add hostf to DNS.
Once DHCP lease is no longer valid, it will remove hostf from DNS.

if you don't define the dhcp-host at all, it will give a DHCP ip and use
the hostname the client passed up to add to DNS and will again remove it
when the lease goes away.

Does that help clarify?

Michael
Spike
2017-08-18 15:30:19 UTC
Permalink
that's very helpful Michael, thank you, works perfectly for my scenario
(and no I don't care about CNAMEs, As are ok).

thanks again,

Spike
Post by Michael
Post by Spike
Dear all,
#CNames
how can I implement cnames in dnsmasq? I have static per mac
assignments in my hosts file and I'd like to add one or more cnames
per host. Is that possible, what's the syntax? I've seen some pages
discussing the topic, but none of the solutions worked for me and more
importantly none of them was specifying more than one cname.
#DNS while host is down
As far as I can see dnsmasq will respond to a host request only if the
host is alive/got a dhcp. Is it possible to override this behavior? If
I have a host definition with an ip, I need that to resolve even if
the host is down.
1) DNS
2) DHCP
3) tftp
4) etc
These jobs can all be interconnected easily within dnsmasq.
Static host for DNS - add to /etc/hosts or specify an alternate (or
additional ) host file w/ addn-hosts=<file> directive.
192.168.1.10 hosta www aliasb aliasc
192.168.1.11 hostb
192.168.1.12 hostc
These entries are permanent and have no dependency on these hosts having
a dhcp lease. www, aliasb, and aliasc are now "aliases" for hosta, but
they are A records and not CNAMES. Do you really require a CNAME or
will A record suffice?
dhcp-host=00:90:a9:f1:b3:e7,hostf
dnsmasq will now provide a dhcp lease to this host. If hostf is in
your hosts file, it will give it that static IP. If it isnt', it will
give you an IP from the dhcp range AND dynamically add hostf to DNS.
Once DHCP lease is no longer valid, it will remove hostf from DNS.
if you don't define the dhcp-host at all, it will give a DHCP ip and use
the hostname the client passed up to add to DNS and will again remove it
when the lease goes away.
Does that help clarify?
Michael
_______________________________________________
Dnsmasq-discuss mailing list
http://lists.thekelleys.org.uk/mailman/listinfo/dnsmasq-discuss
Loading...