1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

External DNS Cache possible?

Discussion in 'Sveasoft Firmware' started by thedogcow, Jun 24, 2005.

  1. thedogcow

    thedogcow Network Guru Member

    With my previous router I was able to get the DHCP to set the dns server for connected computers to a local IP address which was running a caching dns. Is there any way to do this with talisman?
     
  2. 4Access

    4Access Network Guru Member

    I don't have a router with Talisman in front of me right now but on the main Setup page there should be a couple fields called "Static DNS" or something similar that you can fill in along with the other DHCP server options...
     
  3. thedogcow

    thedogcow Network Guru Member

    Yeah thats not where it should go tho as those are the isp's dns servers which should be passed to my caching dns server, instead the routers ip is passed. So basically, the dns cache should be given the isp's dns servers, and the clients should be given the dns caches ip!
     
  4. littlewhoo

    littlewhoo Network Guru Member

    There is an openwrt package of djbdns.
    http://tracker.openwrt.org/packages/show.php?id=2860
    http://cr.yp.to/djbdns.html

    With a little bit of luck you can also run it on Sveasoft Firmware. At least it doesn't seem to depend on additional libraries, which make installation usually a lot more easier. I didn't try djbdns yet, but I'm running quite a few other programs from openwrt packages on Alchemy.
    The .ipk packages from openwrt are just normal .tgz archives. So you can unpack it, look for binaries, libaries and install scripts and try to reproduce the installation manually on Your router.
     
  5. thedogcow

    thedogcow Network Guru Member

    Thanks but i have already got a working dns cache on a seperate machine which also blocks literally 1000's of advert sites from loading, something which the linksys could never handle! I am sure it must be possible, my previous router was a piece of shite!
     
  6. 4Access

    4Access Network Guru Member

    Actually you should be able to specify any DNS servers you want there, including the caching server you setup and they will be assigned to the DHCP clients ... Have you tried it? See image below.

    [​IMG]
    (Hosted by the amazing ImageShack.us!)
     
  7. thedogcow

    thedogcow Network Guru Member

    Yes I have tried that and all clients still only get the dns server as 192.168.1.1 This must be possible somehow! (I know i can simply set up each client to use the dns but still... Would rather a centralised and automatic system)
     
  8. 4Access

    4Access Network Guru Member

    Hmm, that's strange. Almost sounds like a bug. You're sure you don't have the DNS server settings configured statically on your clients right? What firmware are you using? It might be woth it to try another one and see if it behaves any differently.
     
  9. littlewhoo

    littlewhoo Network Guru Member

    If you cant' do it via webinterface, perhaps you can do it at the shell.

    Alchemy (and probably also Talisman) ist using dnsmasq for dns. If you run the command ps, you'll see a process dnsmasq --conf-file /tmp/dnsmasq.conf

    In /tmp/ there are quite a few dnsmasq related configuration files.

    dnsmasq.conf:

    interface=br0
    resolv-file=/tmp/resolv.dnsmasq
    dhcp-leasefile=/tmp/udhcpd.leases

    resolv.conf:

    nameserver 192.168.1.1

    resolv.dnsmasq:

    nameserver 217.237.151.161
    nameserver 217.237.151.33

    I'm not familiar with dnsmasq, but it looks like resolv.conf contains the ip of the nameserver, that is handed out to the clients (by default this is the ip of the WRT54G). Maybe if you change this file to the ip of your dns server and kill/restart dnsmasq, your clients will use the dns-server you want them to use.
     
  10. thedogcow

    thedogcow Network Guru Member

    I tried changing the resolv.conf file in the temp folder, but as i suspected this is recreated every time the router starts up. Help! Maybe I could create a startup script to modify the file on startup? That should work technically right? The only problem would be that the caching dns server would recieve itself as the dns server and not the isp's dns servers. Maybe there is a way to pass the isp's dns servers directly to the user's pc?
     
  11. thedogcow

    thedogcow Network Guru Member

    Progress, by disabling dnsmasq each pc is given the isp's dns servers instead!
     
  12. littlewhoo

    littlewhoo Network Guru Member

    Yes.

    Dont' use dhcp for the computer, the dns cache is running on. Assign it a static IP and enter your isp's dns server ips directly in the network configuration of this computer.
     
  13. thedogcow

    thedogcow Network Guru Member

    OK that should work for the dns cache, setting the servers up there, but even if I run a startup script to modify the file, onle slight problem. Every time the net connection is dropped, the dns servers will be updated when it is connected! I am reading up on dnsmasq as we speak, so hopefully I will find a solution soon. Thanks for all the ideas so far :)
     
  14. 4Access

    4Access Network Guru Member

    I'm not sure what you mean by "the DNS server will be updated"... could you elaborate?

    Also I just tested Alchemy and entering IP addresses into the boxes I noted in the screenshot above does update the /tmp/resolv.dnsmasq file... If it doesn't work for you I'd suspect there's a bug in the version of Talisman you are running. Simply resetting to defaults (hold reset button for 30 sec) and then reconfiguring might be worth a shot if you haven't tried that already.

    Update: Try configuring the IP address of your caching DNS server in the section indicated in the screenshot. Then disable the DNS Masq option on the Administration page. Finally release & renew your IP addresses on your clients and see if you don't get what you are looking for. ;)
     
  15. thedogcow

    thedogcow Network Guru Member

    I think I have figured it out (yes and entering addresses in the above boxes does work, but only creates one entry if they are all the same!). The problem is the pppoe connection updates the resolv.conf, however I think I have fixed this, I will let you guys know if it works and post my script! :D
     
  16. thedogcow

    thedogcow Network Guru Member

    Ok, for those interested here is the working solution for this problem! Simly add the following to your rc_startup script:

    Code:
    kill `cat /tmp/var/run/ppp0.pid`
    grep [^usepeerdns] /tmp/ppp/options.pppoe > /tmp/ppp/options.pppoe.tmp
    cat /tmp/ppp/options.pppoe.tmp > /tmp/ppp/options.pppoe
    /usr/sbin/pppd file /tmp/ppp/options.pppoe
    rm /tmp/ppp/options.pppoe.tmp
    If you are wondering what it does it simply removes the line from the pppd configuration file which tells it to add the ISP's dns servers to the resolv.conf file.

    Enjoy :D

    EDIT
    OK I thought I had this working but there is a catch... The following startup script works fine until the pppoe connection gets reset by the isp, then the settings in the options.pppoe file revert. Kinda sucks eh, would have to be recompiled as an option i spose :(
     
  17. 4Access

    4Access Network Guru Member

    Did you notice the update to my last post above? I believe it's the DNS Masq feature that is causing your problems. Simply disabling it should resolve your problem. At least it appeared to give the results you desired when I tested it...
     
  18. thedogcow

    thedogcow Network Guru Member

    yes I had tried that many times, and it doesn't work the way you think it should, trust me! I am on a pppoe connection I don't know, this may be different for your setup.
     
  19. thedogcow

    thedogcow Network Guru Member

    Changing the following nvram variable works:

    Code:
    nvram set wan_get_dns=""
    Only problem is it doesn't work when in the rc_firewall script :(
     
  20. 4Access

    4Access Network Guru Member

    Have you considered the possibility of creating a script that gets called every few minutes by cron?
     
  21. thedogcow

    thedogcow Network Guru Member

    I've given up on this. I am now using dd-wrt but it still doesn't work. It is not the end of the world tho as i can set the dns on each computer. Just annoying. Perhaps it can be added into a future firmware?
     

Share This Page