Pihole working. Unbound fails to start

Expected Behaviour:

Unbound should run when started.

Actual Behaviour:

Unbound is failing to start with this message:

/etc/unbound/unbound.conf:1: error: stray '''

Debug Token:

I haven't done this yet but I can if needed.

I followed the steps at Redirecting... to add unbound to my already running pihole server (on a Ras Pi running Raspbian stretch) and at first, I thought it was working. I checked the pihole logs today and realized all DNS requests were being handled by 8.8.8.8 (google).

I log into the PI via SSH as 'pi'.

When I do: sudo service unbound restart' and then 'sudo journalctl -u unbound.service', I see:

    Apr 14 19:12:40 thirdpi systemd[1]: Started Unbound DNS server.
    Apr 14 19:12:40 thirdpi unbound[17518]: /etc/unbound/unbound.conf:1: error: stray '''
    Apr 14 19:12:40 thirdpi unbound[17518]: read /etc/unbound/unbound.conf failed: 1 errors in configuration file
    Apr 14 19:12:40 thirdpi unbound[17518]: [1555290760] unbound[17518:0] fatal error: Could not read config file: /etc/unbound.conf

Here is my /etc/unbound/unbound.conf file (not showing the comments):

include: "/etc/unbound/unbound.conf.d/*.conf"

My /etc/unbound/unbound.conf.d/pi-hole.conf file is exactly like the one in the guide.

I searched here and all over the web and can't find this specific "stray ''' " error anywhere else.

Does anyone have any ideas for me?

Thanks!

Don't know it this will help. It's a known fact copying from discourse articles doesn't always succeed. Try typing the include line, erase the original one.

reference article

Thank you but that was not my issue,. My conf file has the 'stright' double-quote characters already. Good thought though.

Since I've not seen any other ideas, I want to ask another question related to this same issue. In the steps in the linked Guide, it doesn't really specify how we should do this, but suggests making the pi-hole.conf file match the file contents shown there. I used nano to create the as named, pasted the contents in there and then saved the file.

When I look at the file now, it is owned by my 'pi' user - not the unbound user.

Could this maybe be a permissions issue? Should I change the owner of that file to be 'unbound' instead?

Thanks again, folks.

These are the permissions for my pihole unbound config file:

-rw-r--r-- 1 root root 2.0K Dec 28 07:52 pi-hole.conf

Hmmm, OK, thank you. My file is owned by 'pi' but otherwise has the -rw-r--r-- permissions, so I believe that means the unbound service user can read it already, yes? So that's not the problem.

Later today I will completely re-create the pi-hole.conf file and see if that helps any. Thanks.

There was a single tick ' on the very first character of the first line of my unbound.conf file and I was just missing it this whole time. Solved. Sorry to bother you all; thanks for the suggestions.

This topic was automatically closed 21 days after the last reply. New replies are no longer allowed.