failed to bind DHCP server?

Discussion in 'Tomato Firmware' started by jsmiddleton4, Jun 13, 2008.

  1. jsmiddleton4

    jsmiddleton4 Network Guru Member

    Dec 31 17:00:08 Tomato-Firmware daemon.crit dnsmasq[90]: failed to bind DHCP server socket: Address already in use

    What does this mean and where should I be looking? I'm using victeks' mode, dnsmasq tweak to increase the cache to 2048, and the dns ad blocker script.
  2. fyellin

    fyellin LI Guru Member

    Is there any chance that you're already running dnsmasq, and that for some reason the script is trying to start up a second one?
  3. HennieM

    HennieM Network Guru Member

    I think fyellin is spot-on. Run, on your Tomato box in an ssh or telnet session

    ps w

    and check if there's any listing of dnsmasq. You can also do

    netstat -an

    and check if you see any port 67 listings, like
    udp        0      0    *
  4. jsmiddleton4

    jsmiddleton4 Network Guru Member

    Thanks. Will check now.
  5. jsmiddleton4

    jsmiddleton4 Network Guru Member

    Tomato v1.19.8850

    BusyBox v1.10.3 (2008-06-10 02:36:30 CEST) built-in shell (ash)
    Enter 'help' for a list of built-in commands.

    /tmp/home/root # ps w
    1 root 1768 S init noinitrd
    2 root 0 SW [keventd]
    3 root 0 SWN [ksoftirqd_CPU0]
    4 root 0 SW [kswapd]
    5 root 0 SW [bdflush]
    6 root 0 SW [kupdated]
    7 root 0 SW [mtdblockd]
    39 root 1744 S buttons
    82 root 2012 S syslogd -m 60 -L -s 50
    83 root 2008 S telnetd -p 23
    86 root 2000 S klogd
    87 root 1812 S nas /etc/nas.conf /var/run/ lan
    97 root 2020 S crond -l 9
    102 root 1288 S rstats
    105 nobody 1012 S dnsmasq
    120 root 1692 S httpd
    145 root 1984 S zebra -d -f /etc/zebra.conf
    159 root 2100 S ripd -d -f /etc/ripd.conf
    276 root 2016 S udhcpc -i vlan1 -s dhcpc-event -H Tomato-Firmware
    374 root 2044 S -sh
    376 root 2024 R ps w


    /tmp/home/root # netstat -an
    Active Internet connections (servers and established)
    Proto Recv-Q Send-Q Local Address Foreign Address State
    tcp 0 0* LISTEN
    tcp 0 0* LISTEN
    tcp 0 0* LISTEN
    tcp 0 0* LISTEN
    tcp 0 0* LISTEN
    tcp 0 460 ESTABLISHED
    udp 0 0*
    udp 0 0*
    udp 0 0*
    udp 0 0*
    udp 0 0*
    raw 0 0* 7
    Active UNIX domain sockets (servers and established)
    Proto RefCnt Flags Type State I-Node Path
    unix 9 [ ] DGRAM 344 /dev/log
    unix 2 [ ACC ] STREAM LISTENING 948 /tmp/.zserv
    unix 2 [ ] DGRAM 1709
    unix 3 [ ] STREAM CONNECTED 1154 /tmp/.zserv
    unix 3 [ ] STREAM CONNECTED 1153
    unix 2 [ ] DGRAM 1112
    unix 2 [ ] DGRAM 947
    unix 2 [ ] DGRAM 738
    unix 2 [ ] DGRAM 654
    unix 2 [ ] DGRAM 651
    unix 2 [ ] DGRAM 350



    nvram set qos_pfifo=1

    Had the 1.95 of the dns poison thing in the WAN up script but do not now, did not before when had this dhcp didn't bind thing in my log. Am about to put it back in and see if that impacts this.

    Victek's 8850 mod and I have the ARP control thing "On", but have left limit if not listed "Off" for now.
  6. jsmiddleton4

    jsmiddleton4 Network Guru Member

    Looks like it is the dns adblocker script. Which if I understand how it works, the error in my log makes sense. Unless I'm wrong the script uses the dnsmasq to do the blocking.
  7. HennieM

    HennieM Network Guru Member

    JS, one instance of dnsmasq is sufficient. I don't know what you are trying to do, but it seems like some changes to dnsmasq's configuration.

    I suggest you make your script doing these changes, do this:
    1) Make your changes
    2) Stop dnsmasq (if it's not running it's fine)
    kill `pidof dnsmasq`
    3) Start dnsmasq

    If you are starting dnsmasq with special parameters, just swap points (1) and (2).
  8. jsmiddleton4

    jsmiddleton4 Network Guru Member


    Kinda assumed one dnsmasq running is not only good enough but probably all one wants to be doing. I removed the dnsmasq poison script, didn't just reboot but instead powered down. Didn't see the dnsmasq failed message. So I'm guessing its a call in that script. But I'm not saying its wrong or buggy. Could be perfectly normal and the only way to run ad blocking kind of things. Just that the dnsmasq failing seems tied to it. Maybe should turn off dnsmasq on the first line of that script so that when the dnsmasq service is turned on in the script, that's the only instance of it?

    Wandering aimlessly there....

    Its this script:


    I don't see any "kill" thing. "Stop"? Yes. Maybe not the same?

    service dnsmasq stop
    sleep 1
    killall -9 dnsmasq
  9. xcooling

    xcooling LI Guru Member

    its the failsafe i added, to prevent the slight posibility the script fails, u will always be able to browse.

    The new version 2.0, adds a message to the log as follows

  10. jsmiddleton4

    jsmiddleton4 Network Guru Member

    Thanks xc..... Your script is evident of thinking the thing through. Thanks for the hard work. Just updated to 2.0.
  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice