(in freetz) let dnsmasq do the walking (now working)

johnbock

Mitglied
Mitglied seit
2 Mrz 2008
Beiträge
310
Punkte für Reaktionen
0
Punkte
0
The current static dhcp configuration routine (in modhosts and dnsmasq_conf) for dnsmasq doesn't allow the dns part work with aliases nor with entries with out a mac.

A conventional configuration looks like
Code:
192.168.0.5 * * myfirsthost description
The following two patches will allow the following
Code:
192.168.0.5 dhcp-host * myfirsthost mfh1 ts # description
And sets up dnsmasq to lease the 192.168.05 to a host announcing itsself as myfirsthost regardless of the mac. The aliases mfh1 and ts will be configured into the hosts file. The hash (#) marks the rest of the line as a comment and will also be put into the hosts file.

These patches, once applied and configured will result in the following:

/var/tmp/flash/exhosts
Code:
10.0.1.101 *                 * delaware       de dns ntp gtw # 07.Dec.1787
10.0.1.102 a0:a1:a2:a3:a4:a5 * new-jersey     nj # 18.Dec.1787
10.0.1.103 dhcp-host         * new-york       ny # 26.Jul.1788

/var/tmp/hosts
Code:
127.0.0.1       localhost
10.0.1.101      delaware de dns ntp gtw # 07.Dec.1787
10.0.1.102      new-jersey nj # 18.Dec.1787
10.0.1.103      new-york ny # 26.Jul.1788

/var/tmp/ethers
Code:
a0:a1:a2:a3:a4:a5       new-jersey
/var/mod/etc/dnsmasq.conf
Code:
domain-needed
bogus-priv
read-ethers
dhcp-host=new-york


Note: the patches may be applied in the top-level freetz-trunk directory with the command
Code:
patch -p1 < patch.file
and follow the instructions from olistudent.
 
Zuletzt bearbeitet:
edit:

now the patch set is working as expected:)
 
Zuletzt bearbeitet:
The patch set is now working as designed and I hope you have as much fun with it as I;)
 
Hi.
The package patch is unnecessary. After applying the first patch you have to do a "make dnsmasq-dirclean" and the changed files will be copied to packages.

Greets Oliver
 
Hi Johnbock ;) ,

I am mainly looking for aliasses (2 URLs for one IP) and do not like to rebuild the FREETZ as long as it is not necessary (maybe I have to do soon for adding IPV6-Tunnle anyways), is this a change in the binariesof DNSmasq or only in the configgfiles mentoned above? And what do I have to add there to get 2 URLs for a given IP and MAC?
.
 
Hi chriwi,

nice to 'read of' you hheerree!

There are no patches neccessary to the dnmasq binary. The two patches above are to allow a more flexible configuration in freetz. For a given ip/mac pair only additional hosts must be specified:
Code:
1.2.3.4 12:23:34:56:78:90 * host alias1 alias2 aliasn # comment
AFAIK, full urls like virtual hosts in apache will probably not work. You could prove me wrong, though;)
 
Zuletzt bearbeitet:
Die Änderungen sind mir nicht so ganz klar. Deshalb hab ich den Patch noch nicht eingecheckt.

MfG Oliver
 
@olistudent

dnsmasq.dhcphost-config.patch.gz
These changes append the description to any 'ip'/'host' line. The description can contain host aliases as well as a comment. A comment must be prepended by a '#' to remain syntactically correct in the hosts file.

dnsmasq.modhosts-alias.gz
These changes configure dnsmasq to assign a static ip address to hosts identifying themselves with a hostname. The mac is irrelevant. And the keyword in the mac column is 'dhcp-host'.

mww-wol_dnsmasq_dhcp-host_alias.patch
Allow wol-cgi to list the correct mac address of hosts that got a dhcp lease with a hostname.

While filing the ticket I accidentally switched the names of the first two patches, sorry:rolleyes:
HTH... If you have any questions, please don't hesitate to contact me;)
 
I have read your ticket.
Do people using dnsmasq have to change something in their conf or does it work like before?
 
Do people using dnsmasq have to change something in their conf or does it work like before?

yes, comments must be prepended with a '#'... Otherwise, each word in the comment will be recognized as an alias.
 
Well, very nice I like your alias patch [host->predefined ip] no need to remember all the MAC-addresses anymore / no need to change the config when the networkcard or mainboard is exchanged!

Thanks!

Greets Manuel
 
@johnbock
Could you please have a look at r2053?

Can I close the ticket?

Greets Oliver
 
Thank you very much for your commitment.
An integration in the next Freetz trunk revision would be great!
 
@johnbock
Could you please have a look at r2053?

Can I close the ticket?

Greets Oliver

Thanx @olistudent. I had forgotten to patch the description:rolleyes:

Just one thing though... I'm not sure if host defs like 'www.local' in 'trunk/root/etc/default.mod/exhosts.def' work. But otherwise, it looks good.

Thank you very much!
 
Maybe it would be nice if comments would be moved to a separate comment field in the web interface?
 
Holen Sie sich 3CX - völlig kostenlos!
Verbinden Sie Ihr Team und Ihre Kunden Telefonie Livechat Videokonferenzen

Gehostet oder selbst-verwaltet. Für bis zu 10 Nutzer dauerhaft kostenlos. Keine Kreditkartendetails erforderlich. Ohne Risiko testen.

3CX
Für diese E-Mail-Adresse besteht bereits ein 3CX-Konto. Sie werden zum Kundenportal weitergeleitet, wo Sie sich anmelden oder Ihr Passwort zurücksetzen können, falls Sie dieses vergessen haben.