Tiny Core Linux
Tiny Core Extensions => TCE Q&A Forum => Topic started by: zab on June 30, 2010, 07:32:19 PM
-
Hi guys,
I'd like to use "dnsmasq" as a DNS cache on my TCL box.
I found this pointer related to Ubuntu:
http://www.ubuntugeek.com/local-dns-cache-for-faster-browsing-on-ubuntu-machine.html
But I'm failing to find the equivalent to "/etc/dhcp3/dhclient.conf" on TCL?
Does someone already try dnsmasq?
Regards
Zab
-
I have not tried it myself, but have you read the .info file for the dnsmasq extension?
-
1. Install dnsmasq.tcz from the repository.
2. Then create the configuration file:
sudo cp /usr/local/etc/dnsmasq.conf.example /usr/local/etc/dnsmasq.conf
3. Edit /usr/local/etc/dnsmasq.conf to your specs.
4. Add the config file to /opt/.filetool.lst
echo "usr/local/etc/dnsmasq.conf" >> /opt./.filetool.lst
5. Run a backup
-
Thanks combo3, I already did all these steps.
But how can I ensure that now, I'm using "dnsmasq" as my primary DNS server?
In the above Ubuntu pointer, they prevent "dhcpc client" to override the "/etc/resolv.conf", and give "dnsmasq" a chance
to works (by putting "nameserver 127.0.0.1" as the first DNS server name) as the primary DNS server.
I'm unable to do that on TCL?
-
Is there a reason why you can't modify resolv.conf?
-
Is there a reason why you can't modify resolv.conf?
I was thinking that the content of "/etc/resolv.conf" was dynamic (as I'm using dhcpcd)!
Am I right?
-
I think I'm right. The content of "/etc/resolv.conf" is made by "udhcpc" (see /usr/share/udhcpc/default.script)
-
So, you could either modify the script to always put your dns as the first one, or have a script to do so in bootlocal.sh.
Restore happens before dhcp, so if you modify the script and add to .filetool.lst, it should work fine.
-
let me try that Curaga
-
Restore happens before dhcp ... so if you modify the script and add to .filetool.lst, it should work fine.
As you said, restore happends before, so it overwrite anything (ex. from /opt/bootlocal.sh).
I decided to handle that with a one-liner script called "~.X.d/dnsmasq":
sed -i '1 i nameserver 127.0.0.1' /etc/resolv.conf
Now, trying (first DNS resolution):
$ dig yahoo.com
...
;; Query time: 34 msec
Any subsequent DNS resolution is blazingly fast:
$ dig yahoo.com
...
;; Query time: 2 msec
1000 thanks guys ;-)
Zab