Add and TXT record?

Could someone please do an FAQ on how I can manually add a TXT record into Pi-hole?

I've just got it setup and so far its working great blocking adds and generally speeding up the internet.

I run an applecaching service accross two internet connections. So I need to add a DNS TXT record. Apple server gives me the bind command which is:
_aaplcache._tcp 259200 IN TXT "prs=CONNECTION1,CONNECTION2"

On my windows box it was easy with a DNS command. However I am not that great with Linux. Big learning curve...

Thanks

You can add custom dnsmasq configs to /etc/dnsmasq.d/: Man page of DNSMASQ

Hi Mcat12

Thanks for taking the time but all that still goes zooming over my head.

Do you have anything a 5year could follow?

you've not seen my youngest daughter. at 13 months she was swiping to unlock an ipad then bashing the screen to open apps usually got safari open...
Now at almost 4 she has her own iPad and plays peppa pig games (with headphones)

Once she starts reading a bit better I'm gonna try and get her and her older brothers involved with Swift.

I ask for instructions a 5 year could follow becuase thats about my level of understanding.

Actually that maybe a bit advanced :thinking:

thanks,

I tried:
dnsmasq txt-record=_aaplcache._tcp,"92.xxx.xxx.xxx,81.xxx.xxx.xxx"

also tried:
dnsmasq txt-record=_aaplcache._tcp,"92.xxx.xxx.xxx, 81.xxx.xxx.xxx"

But it returns junk found in command.

I then tried:
dnsmasq -txt-record=_aaplcache._tcp.FQDN,"92.xxx.xxx.xxx, 81.xxx.xxx.xxx"
And now I get
dnsmasq: failed to create listening socket for port 53: Address already in use

But it returns junk found in command.

I'll look into this today. Had to reply now though because I love your analogies making me chuckle

But just so I am clear (as mud probably)

I can name the file anything I like its whats inside that counts? but for ease of remembrance I will use applecache.conf

If I have something that wants to query where _aaplcache is located I would do

txt-record=_aaplcache,_aaplcache._tcp,"prs=IP address comma seperated"

do they need a space inbetween the IP's?

Cheers
Shaun

this thing is pulling on its lead and dragging me face down :cry:

I copied what you put and got exact same results. So then tried my theory.

Created the file /etc/dnsmasq.d/applecache.conf
This has one line:
txt-record=_aaplcache,_aaplcache._tcp,"prs=92.xxx.xxx.xxx, 81.xxx.xxx.xxx"

The response I get is:

dig txt _applcache

; <<>> DiG 9.10.3-P4-Ubuntu <<>> txt _applcache._tcp
;; global options: +cmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NXDOMAIN, id: 12385
;; flags: qr rd ra; QUERY: 1, ANSWER: 0, AUTHORITY: 1, ADDITIONAL: 1

;; OPT PSEUDOSECTION:
; EDNS: version: 0, flags:; udp: 4096
;; QUESTION SECTION:
;_applcache._tcp. IN TXT

;; AUTHORITY SECTION:
. 3600 IN SOA a.root-servers.net. nstld.verisign-grs.com. 2018091400 1800 900 604800 86400

;; Query time: 657 msec
;; SERVER: 127.0.0.1#53(127.0.0.1)
;; WHEN: Fri Sep 14 12:29:18 BST 2018
;; MSG SIZE rcvd: 119

Even changing my line:
txt-record=_aaplcache._tcp,_aaplcache._tcp,"prs=92.xxx.xxx.xxx, 81.xxx.xxx.xxx"
or
txt-record=_tcp,_aaplcache._tcp,"prs=92.xxx.xxx.xxx, 81.xxx.xxx.xxx"

I've also tried it without prs= but I think the OS X server requires that!

is

pihole restartdns

The correct command or should I be using something else?

Wow just as I thought I was starting to understand it you throw all those numbers and symbols at me. Maybe the bone hit me on the head and those are the birds tweeting round noggin :grin:

anyway my applecache.conf now looks like

txt-record=_aaplcache._tcp.DOMAIN,"prs=92.XXX.XXX.XXX, 81.XXX.XXX.XXX"

and now my output of dig TXT _aaplcache._tcp.DOMAIN is:

dig TXT _aaplcache._tcp.

; <<>> DiG 9.10.3-P4-Ubuntu <<>> TXT _aaplcache._tcp.DOMAIN
;; global options: +cmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 33775
;; flags: qr aa rd ra ad; QUERY: 1, ANSWER: 1, AUTHORITY: 0, ADDITIONAL: 1

;; OPT PSEUDOSECTION:
; EDNS: version: 0, flags:; udp: 4096
;; QUESTION SECTION:
;_aaplcache._tcp.. IN TXT

;; ANSWER SECTION:
_aaplcache._tcp.DOMAIN. 2 IN TXT "prs=92.xxx.xxx.xxx, 81.xxx.xxx.xxx"

;; Query time: 0 msec
;; SERVER: 127.0.0.1#53(127.0.0.1)
;; WHEN: Fri Sep 14 15:01:19 BST 2018
;; MSG SIZE rcvd: 107

Just hope that's actually the correct output. Will dig (no pun intended) out my Caching commands.

Thanks for your help and patience

so I ran back to the tree and cocked my leg :smiley:

I've changed my line to exactly the same as your example and I get the same result as I did before when I had .domain.com added to it.

I am sure I had already tried that configuration and it didn't work. Maybe I had a typo!

When I had the domain.com added I tried the Assetcachelocatorutil from the mac and it didn't return any configured public IP address. My understanding is it pulls the public IP's from the DNS record by querying _aaplcache._tcp. Which is only needed if using multiple public IPs. I think but again could and probably I am wrong.

The Mac is currently downloading a file. I'll give it a reboot once its finished to refresh its DNS. Then I'll the locator util again

Still cant get it to work.

Dig returns a result as above. Even if I run it on the Mac it gets the same result. Expected as Mac is using PiHole for its DNS.

If I run Assetcachelocatorutil on the mac mini it doesn't find any configured public IP address. But it does find the content cache (Its on the mac mini) so thats expected

Then on a mac book also using PiHole as DNS I get same dig result (expected) and if I run Assetcachelocatorutil it doesnt find any content caches and also states no public IP address configured.

They are on the same subnet but Firewall uses different internet connection for them. but it should see the cache as they are on the same subnet (at least it did when using windows)

I've tried it all combinations of adding search domain and a trailing DOT.

If I dig _aaplcache._tcp @windows-domain-server

I get the same results as having my applecache.conf set to:

txt-record=_aaplcache._tcp,"prs=92.xxx.xxx.xxx, 81.xxx.xxx.xxx"

Reading the link you provided it states that the TXT record needs to be published in the default search domain. With that in mind am I still creating \ editing the file in the correct location '/etc/dnsmasq.d/applecache.conf'
Or should I be placing it somewhere else?

1 Like

Unfortunately I am out of time here. I have reverted back to using the windows DNS but use the PiHole as a forwarder so the AD-Blocking still works. Just makes it a little more difficult to to narrow down client issues.

I am going to have a read up a little more on DNS within linux. To try and get a better understanding of how it works in Linux.

My caching now works, and using windows as my DNS I get the same results with DIG TXT _aaplcache._tcp as I did when using PiHole directly.