Netgate SG-1000 microFirewall

Author Topic: Add PTR and NS Records to DNS Resolver possible?  (Read 2621 times)

0 Members and 1 Guest are viewing this topic.

Offline johnpoz

  • Hero Member
  • *****
  • Posts: 15168
  • Karma: +1413/-206
  • Not a pfSense employee, they cannot fire me...
    • View Profile
Re: Add PTR and NS Records to DNS Resolver possible?
« Reply #60 on: January 17, 2018, 08:29:31 am »
Problem with that config is that your SOA for example.com is cloud1.example.com

But I take it cloud5 is the mobility server but its a example.com domain ns, so do cloud1 and cloud5 the NS for example.com have the same records?

What does pc-printer-discovery.example.com. actually resolve too?  Since from your config I should be able to answer either cloud1 the SOA for example.com or cloud5 for this A record.
- An intelligent man is sometimes forced to be drunk to spend time with his fools.
- Please don't PM me for personal help
- if you want to say thanks applaud or https://www.freebsdfoundation.org/donate/
1x SG-2440 2.4.2-RELEASE-p1 (work)
1x SG-4860 2.4.2-RELEASE-p1 (home)

Offline thehammer86

  • Jr. Member
  • **
  • Posts: 71
  • Karma: +1/-0
    • View Profile
Re: Add PTR and NS Records to DNS Resolver possible?
« Reply #61 on: January 17, 2018, 08:54:33 am »
Both PaperCutNG and the MobilityPrint Server are on the same machine (cloud5).  I can't seem to track down the log entry from MobilityPrint but its starting to come back to me now.  Something about the log error hinted at a permission issue with Unbound.  Because Unbound is set up as an authoritative name server for example.com, it didn't like cloud5.example.com being an authoritative name server for the subdomain pc-printer-discovery.example.com.

Does that help?

I coundn't get any further with unbound so that's why I ditched it and went to bind.

Offline johnpoz

  • Hero Member
  • *****
  • Posts: 15168
  • Karma: +1413/-206
  • Not a pfSense employee, they cannot fire me...
    • View Profile
Re: Add PTR and NS Records to DNS Resolver possible?
« Reply #62 on: January 17, 2018, 10:21:32 am »
and when you do a query for pc-printer-discovery.example.com, is this a A record query TXT, SRV what?

Seems pretty pointless to set it up that way..   Why could you not just setup pc-printer-discovery.example.com to be resolved by unbound directly? Be it A record or TXT or SRV, etc.  Seems stupid to do it that way.. I see no point to it.

Actually goes against dns practice to delegate like that. Why sure pc-printer-discovery.example.com could be sub domain and delegated to a different NS.  you would then look fror something like host.pc-printer-discovery.example.com in the subdomain.

Unbound is not actually meant to be an authoritative NS.. So that is prob why there are some issues - but you could for sure just put in the entry for pc-printer-discovery.example.com directly in unbound so it could resolve it without having to delegate that to cloud5..

Unbound is a validating, recursive, and caching DNS resolver.  It is not actually meant to be an authoritative NS... While it can answer specific records, from a local database - it has issues with cnames as well, etc.  Since its not actual designed to be an authoritative NS.

But if the client wants to do a PTR query and then a query for that fqdn that is returned it for sure could answer a A, TXT, SRV record etc... for the actual fqdn that gets queried.
- An intelligent man is sometimes forced to be drunk to spend time with his fools.
- Please don't PM me for personal help
- if you want to say thanks applaud or https://www.freebsdfoundation.org/donate/
1x SG-2440 2.4.2-RELEASE-p1 (work)
1x SG-4860 2.4.2-RELEASE-p1 (home)

Offline Selo

  • Newbie
  • *
  • Posts: 6
  • Karma: +0/-0
    • View Profile
Re: Add PTR and NS Records to DNS Resolver possible?
« Reply #63 on: January 17, 2018, 10:58:55 am »
I just got feedback from Papercut support:

"
(PaperCut)


I apologize but presently we don't have a documented method to set up the DNS records for Mobility Print using Unbound with PFSense. However, I do want to point out that other customers with PFsense routers that want to use DNS Discovery for Mobility Print have reached out to us to see if this is something that can be achieved.  I previously created a to-do item in our feature tracking system for our developers to take a look at whether this is feasible. I have also linked this support ticket to the feature request so that we can notify you by email in the future if this is something we are able to document. I can't say when we would be able to answer this however.

In the short term I would also like to point out that there are several other methods for setting up Mobility Print, even for environments with multiple subnets and VLANs. For example, you can connect multiple network interfaces to your Mobility Print server and allow it to broadcast mDNS to advertise printers to clients in each network. Alternatively if your router supports Bonjour Forwarding, then you could set it up to allow mDNS traffic to pass from your server VLAN to your client VLANs.

Let me know if you have any questions at all or if you would like to discuss some of the alternate methods I mentioned above.

"

Offline johnpoz

  • Hero Member
  • *****
  • Posts: 15168
  • Karma: +1413/-206
  • Not a pfSense employee, they cannot fire me...
    • View Profile
Re: Add PTR and NS Records to DNS Resolver possible?
« Reply #64 on: January 17, 2018, 11:04:02 am »
You could most likely just use the avahi package with pfsense.. It does mDNS/DNS-SD

- An intelligent man is sometimes forced to be drunk to spend time with his fools.
- Please don't PM me for personal help
- if you want to say thanks applaud or https://www.freebsdfoundation.org/donate/
1x SG-2440 2.4.2-RELEASE-p1 (work)
1x SG-4860 2.4.2-RELEASE-p1 (home)

Offline Derelict

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 9811
  • Karma: +1107/-311
    • View Profile
Re: Add PTR and NS Records to DNS Resolver possible?
« Reply #65 on: January 17, 2018, 12:13:47 pm »
DNS Resolver Custom Options:

server:
local-zone: "example.com." transparent
local-data: "b.dns-sd._udp IN PTR pc-printer-discovery.example.com."
local-data: "lb.dns-sd._udp IN PTR pc-printer-discovery.example.com."
local-data: "pc-printer-discovery.example.com. IN NS print-server-host.example.com."
local-data: "print-server-host.example.com. IN A 192.168.224.17"

Test queries:

[2.4.2-RELEASE][root@pfSense-b.example.com]/var/unbound: dig +short +search +domain=example.com @localhost PTR b.dns-sd._udp
pc-printer-discovery.example.com.
[2.4.2-RELEASE][root@pfSense-b.example.com]/var/unbound: dig +short +search +domain=example.com @localhost PTR lb.dns-sd._udp
pc-printer-discovery.example.com.
[2.4.2-RELEASE][root@pfSense-b.example.com]/var/unbound: dig +short +search +domain=example.com @localhost NS pc-printer-discovery
print-server-host.example.com.
[2.4.2-RELEASE][root@pfSense-b.example.com]/var/unbound: dig +short +search +domain=example.com @localhost A print-server-host
192.168.224.17


From there it is up to the client to ask the DNS server on the mobility print server at 192.168.224.17 whatever it needs to ask about the pc-printer-discovery zone.

It looks to me like this should work. It implies the client is pointed EXCLUSIVELY at unbound (and/or a similarly-configured server) and has a correct search domain set for "example.com".

I did not try to get a Mobility Print environment working.
Las Vegas, Nevada, USA
Use this diagram to describe your issue.
The pfSense Book is now available for just $24.70!
Do Not PM For Help! NO_WAN_EGRESSTM

Offline Derelict

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 9811
  • Karma: +1107/-311
    • View Profile
Re: Add PTR and NS Records to DNS Resolver possible?
« Reply #66 on: January 17, 2018, 12:21:53 pm »
Note that unbound agrees with my prior assessment of the wackiness of the name-keyed PTR records. They have a local-data-ptr option for setting PTR records:


local-data-ptr: "IPaddr name"
            Configure local data shorthand for a PTR record with the  reversed
            IPv4  or  IPv6  address and the host name.  For example "192.0.2.4
            www.example.com".  TTL can be  inserted  like  this:  "2001:DB8::4
            7200 www.example.com"


If you try something like:


local-data-ptr: "b.dns-sd._udp pc-printer-discovery.example.com."


It barfs with:


The generated config file cannot be parsed by unbound. Please correct the following errors:
[1516213033] unbound-checkconf[27521:0] error: syntax error: cannot parse address: b.dns-sd._udp pc-printer-discovery.example.com.
/var/unbound/test/unbound.conf:86: error: local-data-ptr could not be reversed
read /var/unbound/test/unbound.conf failed: 1 errors in configuration file
Las Vegas, Nevada, USA
Use this diagram to describe your issue.
The pfSense Book is now available for just $24.70!
Do Not PM For Help! NO_WAN_EGRESSTM

Offline johnpoz

  • Hero Member
  • *****
  • Posts: 15168
  • Karma: +1413/-206
  • Not a pfSense employee, they cannot fire me...
    • View Profile
Re: Add PTR and NS Records to DNS Resolver possible?
« Reply #67 on: January 17, 2018, 01:27:23 pm »
Where the problem is I do not believe the client follows through with looking up pc-printer-discovery.example.com.

When NS is authoritative its different - same issue with a cname in unbound.  You can for sure put in a cname record.. But it doesn't follow through and finish, its up the client to follow the query when the not using authoritative ns, etc.

If the client actually does a query for pc-printer-discovery.example.com. you could just put that record in unbound directly..
- An intelligent man is sometimes forced to be drunk to spend time with his fools.
- Please don't PM me for personal help
- if you want to say thanks applaud or https://www.freebsdfoundation.org/donate/
1x SG-2440 2.4.2-RELEASE-p1 (work)
1x SG-4860 2.4.2-RELEASE-p1 (home)

Offline Derelict

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 9811
  • Karma: +1107/-311
    • View Profile
Re: Add PTR and NS Records to DNS Resolver possible?
« Reply #68 on: January 17, 2018, 01:44:07 pm »
It looks to me like pc-printer-discovery.example.com is a subdomain. Those records/that zone will be found on the mobility print server itself.

At least that's what it looks like to me.

I am really not in the mood to install it and see.

It looks like the above config is what is necessary to get the records papercut say need to be there in there.
Las Vegas, Nevada, USA
Use this diagram to describe your issue.
The pfSense Book is now available for just $24.70!
Do Not PM For Help! NO_WAN_EGRESSTM

Offline johnpoz

  • Hero Member
  • *****
  • Posts: 15168
  • Karma: +1413/-206
  • Not a pfSense employee, they cannot fire me...
    • View Profile
Re: Add PTR and NS Records to DNS Resolver possible?
« Reply #69 on: January 17, 2018, 02:06:17 pm »
"It looks like the above config is what is necessary to get the records papercut say need to be there in there."

Yeah went through that while back - doesn't work, because yes pc-printer-discovery.example.com is a subdomain delegation... Its hokey setup to be sure.. Trying to put these records into unbound make no sense at all..  The whole thing is designed for the authoritative NS for the domain in question which is not what unbound running on pfsense is

http://www.dns-sd.org/serverstaticsetup.html

You really should be able to get away with a domain override for the domain

_dns-sd._udp.example.com

Point  _dns-sd._udp.example.com via NS record to the mobility print server let the client do whatever it wants via a domain override.

I would think it just much easier to setup avahi..

If user really wants to use this setup and run it on pfsense, then they should be using the bind package that gives them full authoritative nameserver software on pfsense - with a gui to boot to manage ;)
- An intelligent man is sometimes forced to be drunk to spend time with his fools.
- Please don't PM me for personal help
- if you want to say thanks applaud or https://www.freebsdfoundation.org/donate/
1x SG-2440 2.4.2-RELEASE-p1 (work)
1x SG-4860 2.4.2-RELEASE-p1 (home)

Offline thehammer86

  • Jr. Member
  • **
  • Posts: 71
  • Karma: +1/-0
    • View Profile
Re: Add PTR and NS Records to DNS Resolver possible?
« Reply #70 on: January 17, 2018, 02:12:55 pm »
Unfortunately, I already tried avahi. The mobility app under android and windows returns an error that I haven't been able to sort out with the Paperacut team.

Offline Derelict

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 9811
  • Karma: +1107/-311
    • View Profile
Re: Add PTR and NS Records to DNS Resolver possible?
« Reply #71 on: January 17, 2018, 02:24:08 pm »
Then pcap the DNS traffic and see where the breakdown is.
Las Vegas, Nevada, USA
Use this diagram to describe your issue.
The pfSense Book is now available for just $24.70!
Do Not PM For Help! NO_WAN_EGRESSTM

Offline johnpoz

  • Hero Member
  • *****
  • Posts: 15168
  • Karma: +1413/-206
  • Not a pfSense employee, they cannot fire me...
    • View Profile
Re: Add PTR and NS Records to DNS Resolver possible?
« Reply #72 on: January 17, 2018, 02:28:09 pm »
Can for sure make unbound answer pretty much anything that gets queried for.. But its not going to do some of the stuff an actual authoritative NS does for a zone its authoritative for, etc.

If you do a sniff and see what is queried - pretty freaking sure can make unbound answer with the answer you want for the specific query and type.
- An intelligent man is sometimes forced to be drunk to spend time with his fools.
- Please don't PM me for personal help
- if you want to say thanks applaud or https://www.freebsdfoundation.org/donate/
1x SG-2440 2.4.2-RELEASE-p1 (work)
1x SG-4860 2.4.2-RELEASE-p1 (home)

Offline Selo

  • Newbie
  • *
  • Posts: 6
  • Karma: +0/-0
    • View Profile
Re: Add PTR and NS Records to DNS Resolver possible?
« Reply #73 on: January 17, 2018, 02:47:54 pm »
I can confirm Avahi is not working. Just tested it.
The mobility print setup does not find any printers in another VLAN.

Offline johnpoz

  • Hero Member
  • *****
  • Posts: 15168
  • Karma: +1413/-206
  • Not a pfSense employee, they cannot fire me...
    • View Profile
Re: Add PTR and NS Records to DNS Resolver possible?
« Reply #74 on: January 17, 2018, 02:53:26 pm »
love to see a sniff of these dns queries being done on your working system..  I want to see what the query and answer look like for pc-printer-discovery.example.com
- An intelligent man is sometimes forced to be drunk to spend time with his fools.
- Please don't PM me for personal help
- if you want to say thanks applaud or https://www.freebsdfoundation.org/donate/
1x SG-2440 2.4.2-RELEASE-p1 (work)
1x SG-4860 2.4.2-RELEASE-p1 (home)