3

I'm using Elementary OS Freya (Ubuntu 14.04). I've install DNSMASQ and running the command and getting the error below:

$ sudo service dnsmasq start
 * Starting DNS forwarder and DHCP server dnsmasq
dnsmasq: bad command line options: try --help     [fail]

In the /var/log/syslog, I found:

Dec 22 10:34:10 Marcelo-PC dnsmasq[3176]: bad command line options: try --help
Dec 22 10:34:10 Marcelo-PC dnsmasq[3176]: FAILED to start up

Running sh -x /etc/init.d/dnsmasq I get:

marcelo@Marcelo-PC:~$ sh -x /etc/init.d/dnsmasq start
+ set +e
+ PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin
+ DAEMON=/usr/sbin/dnsmasq
+ NAME=dnsmasq
+ DESC=DNS forwarder and DHCP server
+ ENABLED=1
+ [ -r /etc/default/dnsmasq ]
+ . /etc/default/dnsmasq
+ ENABLED=1
+ CONFIG_DIR=/etc/dnsmasq.d,.dpkg-dist,.dpkg-old,.dpkg-new
+ [ -r /etc/default/locale ]
+ . /etc/default/locale
+ LANG=en_US.UTF-8
+ export LANG
+ test -x /usr/sbin/dnsmasq
+ [ -f /lib/lsb/init-functions ]
+ . /lib/lsb/init-functions
+ run-parts --lsbsysinit --list /lib/lsb/init-functions.d
+ [ -r /lib/lsb/init-functions.d/01-upstart-lsb ]
+ . /lib/lsb/init-functions.d/01-upstart-lsb
+ unset UPSTART_SESSION
+ _RC_SCRIPT=/etc/init.d/dnsmasq
+ [ -r /etc/init//etc/init.d/dnsmasq.conf ]
+ _UPSTART_JOB=dnsmasq
+ [ -r /etc/init/dnsmasq.conf ]
+ [ -r /lib/lsb/init-functions.d/20-left-info-blocks ]
+ . /lib/lsb/init-functions.d/20-left-info-blocks
+ [ -r /lib/lsb/init-functions.d/50-ubuntu-logging ]
+ . /lib/lsb/init-functions.d/50-ubuntu-logging
+ LOG_DAEMON_MSG=
+ FANCYTTY=
+ [ -e /etc/lsb-base-logging.sh ]
+ true
+ [ !  ]
+ [  != yes ]
+ [ -x /sbin/resolvconf ]
+ RESOLV_CONF=/var/run/dnsmasq/resolv.conf
+ [ !  ]
+ DNSMASQ_USER=dnsmasq
+ test 1 != 0
+ log_daemon_msg Starting DNS forwarder and DHCP server dnsmasq
+ [ -z Starting DNS forwarder and DHCP server ]
+ log_use_fancy_output
+ TPUT=/usr/bin/tput
+ EXPR=/usr/bin/expr
+ [ -t 1 ]
+ [ xxterm != x ]
+ [ xxterm != xdumb ]
+ [ -x /usr/bin/tput ]
+ [ -x /usr/bin/expr ]
+ /usr/bin/tput hpa 60
+ /usr/bin/tput setaf 1
+ [ -z ]
+ FANCYTTY=1
+ true
+ /usr/bin/tput xenl
+ /usr/bin/tput cols
+ COLS=169
+ [ 169 ]
+ [ 169 -gt 6 ]
+ /usr/bin/expr 169 - 7
+ COL=162
+ log_use_plymouth
+ [ n = y ]
+ plymouth --ping
+ printf  * Starting DNS forwarder and DHCP server dnsmasq      
 * Starting DNS forwarder and DHCP server dnsmasq       + /usr/bin/expr 169 - 1
+ /usr/bin/tput hpa 168
                                                                                                                                                                        + printf  
 + start
+ [ ! -d /var/run/dnsmasq ]
+ start-stop-daemon --start --quiet --pidfile /var/run/dnsmasq/dnsmasq.pid --exec /usr/sbin/dnsmasq --test
+ start-stop-daemon --start --quiet --pidfile /var/run/dnsmasq/dnsmasq.pid --exec /usr/sbin/dnsmasq -- -x /var/run/dnsmasq/dnsmasq.pid -u dnsmasq -r /var/run/dnsmasq/resolv.conf -7 /etc/dnsmasq.d,.dpkg-dist,.dpkg-old,.dpkg-new

dnsmasq: opções inválidas de linha de comando: tente --help
+ return 2
+ log_end_msg 1
+ [ -z 1 ]
+ [ 162 ]
+ [ -x /usr/bin/tput ]
+ log_use_plymouth
+ [ n = y ]
+ plymouth --ping
+ printf \r
+ /usr/bin/tput hpa 162
                                                                                                                                                                  + [ 1 -eq 0 ]
+ printf [
[+ /usr/bin/tput setaf 1
+ printf fail
fail+ /usr/bin/tput op
+ echo ]
]
+ return 1
+ exit 1

And I can't put the DNSMASQ to work. The only uncommented line in my dnsmasq.conf is (you can see the entire file here):

address=/nintendowifi.net/192.168.0.8

How can I see what the problem is?

  • I deleted my answer since that wasn't the right solution. Try running the command manually. Run /usr/sbin/dnsmasq -- -x /var/run/dnsmasq/dnsmasq.pid -u dnsmasq -r /var/run/dnsmasq/resolv.conf -7 /etc/dnsmasq.d,.dpkg-dist,.dpkg-old,.dpkg-new and post the results here. I still think it's strange that the -- is there before the options. . . – terdon Dec 22 '16 at 20:08
  • dnsmasq: junk found in command line that was the result – Marcelo Rodovalho Dec 23 '16 at 2:05
0

The error is a problem with the package dns-root-data. DNSmasq shouldn't require it, but it is requiring it. Follow these steps:

sudo apt-get purge dnsmasq
sudo apt-get autoremove
sudo apt-get install dnsmasq

Don't forget to re-insert your configuration (if any) into /etc/dnsmasq.conf

Reference


If that didn't work, try this (works at least on Debian 9 and Raspian)

sudo nano /etc/init.d/dnsmasq

Where it reads

if [ -f $ROOT_DS ]; then

Comment out the next line (add # to the beginning of the line) and put this one below it

`DNSMASQ_OPTS="$DNSMASQ_OPTS `mawk -- '{ printf " --trust-anchor=.,%d,%d,%d,%s", $5, $6, $7, $8 }' $ROOT_DS`"`

The structure of /usr/share/dns/root.ds was changed. The fields used to be separated only by spaces, now they are separated by tabs (\t)

Reference

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.