Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

I can't restart my dnsmasq service, so my fog server won't work

I have a fog server set up in work, every now and then our useless internet fails and I have to reset the dnsmasq to get it working again, (don't have a dhcp server set up and can't modify the hubs settings so won't be doing this). Whenever I try sudo dnsmasq restart, I get the message:

junk found in command line.

First of all, can some please explain to me in simple terms what this actually means? As I am no Linux expert and nobody seems to have a simple explanation as to what this is...

Secondly, I have always used the command posted on another the fog forum to correct this error.

sudo /etc/init.d/dnsmasq restart

This always worked perfectly however now when I try to run this command I get the message:

command not found`.

like image 925
Stephen Fig Roll Smith Avatar asked Dec 12 '22 14:12

Stephen Fig Roll Smith


2 Answers

Edit your /etc/init.d/dnsmasq

My linux distribution is Debian 9 (stretch)

Change this line :

ROOT_DS="/usr/share/dns/root.ds"

if [ -f $ROOT_DS ]; then
   DNSMASQ_OPTS="$DNSMASQ_OPTS `sed -e s/". IN DS "/--trust-anchor=.,/ -e s/" "/,/g $ROOT_DS | tr '\n' ' '`" 
fi

To :

ROOT_DS="/usr/share/dns/root.ds"

if [ -f $ROOT_DS ]; then
   DNSMASQ_OPTS="$DNSMASQ_OPTS `sed -e s/".*IN[[:space:]]DS[[:space:]]"/--trust-anchor=.,/ -e s/"[[:space:]]"/,/g $ROOT_DS | tr '\n' ' '`" 
fi

This problem occurs due to updating the dns-root-data package, more precisely in the file /usr/share/dns/root.ds.

The structure of this file was changed, the fields were separated only by spaces, now they were changed by tabs (\t)

like image 151
Marcos Tischer Vallim Avatar answered Dec 14 '22 02:12

Marcos Tischer Vallim


sudo service dnsmasq start

That worked for me

like image 25
user168345 Avatar answered Dec 14 '22 02:12

user168345