How to add DNS record

Hi,

Im trying to configure my IPFire Server to have a DNS record to inform clients of my Apple Cache Server. I have been trying to follow instructions from multiple locations, especially here. I can get the command

“unbound-control local_data _aaplcache._tcp.mydomain. 14400 TXT prs=1.2.3.4”

to report

“ok”

But I can’t find any sign that its working, including testing via

“dig txt _applcache._tcp.mydomain.”

I tried adding

“local-data: ‘_aaplcache._tcp.mydomain. 14400 TXT “prs=1.2.3.4”’”

to unbound.conf then restarting, but when I do that I get:

Stopping Unbound DNS Proxy...    Not running.                                                                                                                                                                                        [ WARN ]
Starting Unbound DNS Proxy...
/etc/unbound/unbound.conf:92: error: syntax error
read /etc/unbound/unbound.conf failed: 1 errors in configuration file
[1574146387] unbound[10191:0] fatal error: Could not read config file: /etc/unbound/unbound.conf. Maybe try unbound -dd, it stays on the commandline to see more errors, or unbound-checkconf                                        [ FAIL ]
/etc/unbound/unbound.conf:92: error: syntax error
read /etc/unbound/unbound.conf failed: 1 errors in configuration file
[1574146387] unbound-control[10193:0] fatal error: could not read config file
/etc/unbound/unbound.conf:92: error: syntax error
read /etc/unbound/unbound.conf failed: 1 errors in configuration file
[1574146387] unbound-control[10195:0] fatal error: could not read config file
Configuring upstream name server(s): x.x.x.x x.x.x.x                                                                                                                                                                           [  OK  ]
/etc/unbound/unbound.conf:92: error: syntax error
read /etc/unbound/unbound.conf failed: 1 errors in configuration file
[1574146389] unbound-control[10291:0] fatal error: could not read config file
/etc/unbound/unbound.conf:92: error: syntax error
read /etc/unbound/unbound.conf failed: 1 errors in configuration file
[1574146389] unbound-control[10292:0] fatal error: could not read config file
/etc/unbound/unbound.conf:92: error: syntax error
read /etc/unbound/unbound.conf failed: 1 errors in configuration file
[1574146389] unbound-control[10293:0] fatal error: could not read config file
/etc/unbound/unbound.conf:92: error: syntax error
read /etc/unbound/unbound.conf failed: 1 errors in configuration file
[1574146389] unbound-control[10294:0] fatal error: could not read config file
DNS still not functioning... Trying to sync time with ntp.ipfire.org (81.3.27.46)...  

I don’t see anything relevant in the Unbound logs from the system logs. Any insights to help me? Thanks.

I think the file needs to read like this:

server:
    local-data: ...

Can you try that?

I assume you are trying an extra file in /etc/unbound/local.d.

Thanks for the input Michael! That was able to get me on the right road. The working version of the file (/etc/unbound/local.d/aaplcache.conf) is:

server:
local-data: “_aaplcache._tcp.mydomain. 14400 TXT “prs=1.2.3.4””

It is difficult to tell on this page, but I was using a single quote around the local-data portion, but a double quote (yes, with nested double quotes on the prs statement) was correct. Now unbound will restart (/etc/init.d/unbound restart) normally and when I send the command (from any computer on the network):

dig txt _applcache._tcp.mydomain.

I get a correct answer from the DNS server and the Apple devices seem to be finding the cache correctly. Again, I appreciate the help. I would also like to point out that I found parts of my answer here.