Netgate Discussion Forum
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Search
    • Register
    • Login

    Add PTR and NS Records to DNS Resolver possible?

    Scheduled Pinned Locked Moved DHCP and DNS
    99 Posts 14 Posters 36.5k Views
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • DerelictD
      Derelict LAYER 8 Netgate
      last edited by

      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

      Chattanooga, Tennessee, USA
      A comprehensive network diagram is worth 10,000 words and 15 conference calls.
      DO NOT set a source address/port in a port forward or firewall rule unless you KNOW you need it!
      Do Not Chat For Help! NO_WAN_EGRESS(TM)

      1 Reply Last reply Reply Quote 0
      • johnpozJ
        johnpoz LAYER 8 Global Moderator
        last edited by

        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
        If you get confused: Listen to the Music Play
        Please don't Chat/PM me for help, unless mod related
        SG-4860 24.11 | Lab VMs 2.8, 24.11

        1 Reply Last reply Reply Quote 0
        • DerelictD
          Derelict LAYER 8 Netgate
          last edited by

          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.

          Chattanooga, Tennessee, USA
          A comprehensive network diagram is worth 10,000 words and 15 conference calls.
          DO NOT set a source address/port in a port forward or firewall rule unless you KNOW you need it!
          Do Not Chat For Help! NO_WAN_EGRESS(TM)

          1 Reply Last reply Reply Quote 0
          • johnpozJ
            johnpoz LAYER 8 Global Moderator
            last edited by

            "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
            If you get confused: Listen to the Music Play
            Please don't Chat/PM me for help, unless mod related
            SG-4860 24.11 | Lab VMs 2.8, 24.11

            1 Reply Last reply Reply Quote 0
            • K
              kolpinkb
              last edited by

              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.

              1 Reply Last reply Reply Quote 0
              • DerelictD
                Derelict LAYER 8 Netgate
                last edited by

                Then pcap the DNS traffic and see where the breakdown is.

                Chattanooga, Tennessee, USA
                A comprehensive network diagram is worth 10,000 words and 15 conference calls.
                DO NOT set a source address/port in a port forward or firewall rule unless you KNOW you need it!
                Do Not Chat For Help! NO_WAN_EGRESS(TM)

                1 Reply Last reply Reply Quote 0
                • johnpozJ
                  johnpoz LAYER 8 Global Moderator
                  last edited by

                  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
                  If you get confused: Listen to the Music Play
                  Please don't Chat/PM me for help, unless mod related
                  SG-4860 24.11 | Lab VMs 2.8, 24.11

                  1 Reply Last reply Reply Quote 0
                  • S
                    Selo
                    last edited by

                    I can confirm Avahi is not working. Just tested it.
                    The mobility print setup does not find any printers in another VLAN.

                    1 Reply Last reply Reply Quote 0
                    • johnpozJ
                      johnpoz LAYER 8 Global Moderator
                      last edited by

                      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
                      If you get confused: Listen to the Music Play
                      Please don't Chat/PM me for help, unless mod related
                      SG-4860 24.11 | Lab VMs 2.8, 24.11

                      1 Reply Last reply Reply Quote 0
                      • P
                        posto587
                        last edited by

                        @johnpoz:

                        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

                        We are going to install a test environment within the next days with papercut NG/MF and mobility print.
                        We could give Teamviewer or VPN connection.

                        1 Reply Last reply Reply Quote 0
                        • johnpozJ
                          johnpoz LAYER 8 Global Moderator
                          last edited by

                          K..

                          An intelligent man is sometimes forced to be drunk to spend time with his fools
                          If you get confused: Listen to the Music Play
                          Please don't Chat/PM me for help, unless mod related
                          SG-4860 24.11 | Lab VMs 2.8, 24.11

                          1 Reply Last reply Reply Quote 0
                          • S
                            SimonP
                            last edited by

                            @selo said in Add PTR and NS Records to DNS Resolver possible?:

                            Hello,

                            First I want to say that I'm using Mobility print with my PFSense since 6 months and everyhting's is working fine with AVAHI package and mDNS on my Mobility print server
                            But as Avahi package spread accross the differents VLAN I want a more secure configuration, so I start to work about switching from mDNS to DNS

                            As I'm not an expert, I asked Papercut a hand on this. It didn't seem possible to configure DNS with "DNS Resolver", so I installed the "BIND" package on my PFSense
                            On the same VLAN, the client can installed Mobility print on the windows, and launch a print job.
                            But now I put the windows workstation on another VLAN, and even if the record didn't changed, I can't reach my server and install Mobility print

                            I'm still talking with Papercut team to solve that problem, I have the impression that with BIND it's working a little bit better than DNS resolver ? Maybe there is some updates on your side since 5 months ?

                            1 Reply Last reply Reply Quote 0
                            • johnpozJ
                              johnpoz LAYER 8 Global Moderator
                              last edited by johnpoz

                              I have not looked at this crap since we ended it. The way they are doing is just stupid if you ask me. They don't even seem to understand how their own product works.

                              Its not a difficult to manually setup dns records for airprint.. But to be honest this makes no sense to setup unless you have clients you do not control that you want to find your printer. Or shitty ass clients that do not allow for setup of the printer.

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

                              Why would you not just point your client directly to the printer or the print server via their IP or FQDN that resolves.

                              I can print from any vlan - just point the clients to brother.local.lan = done ;) If your running bind as your authoritative ns and your main dns now for all your clients I would suggest you get with them on the correct records to place in it - for follow the info I linked too above for setting up dns-sd

                              An intelligent man is sometimes forced to be drunk to spend time with his fools
                              If you get confused: Listen to the Music Play
                              Please don't Chat/PM me for help, unless mod related
                              SG-4860 24.11 | Lab VMs 2.8, 24.11

                              1 Reply Last reply Reply Quote 1
                              • S
                                SimonP
                                last edited by

                                Thanks for your update.
                                I'm really not a DNS jedi, so I just followed the tutorial from Papercut. Since I read many things about DNS, now some things are crystal clear, other not.
                                So I will try your solution. Airprint was just so easy to configure for the computer who are only on the building for 2 days, instead of the installation with IP, with the proper driver, the Papercut client etc ... it's only few minutes more, but X times a week it's a lot a wasted time !
                                And before that I didn't use any DNS server, so there are a lot to learn and process

                                1 Reply Last reply Reply Quote 0
                                • johnpozJ
                                  johnpoz LAYER 8 Global Moderator
                                  last edited by

                                  Tell you what... I have some clients (ipad, iphone, etc) that pretty much need airprint to work. If I get a chance after work I will move my printer to my lan vs the secured wireless (the printer supports airprint) so a long as devices are on the same L2 they find the printer directly.

                                  This has been on my sort of todo list for awhile ;) But since I only allow my devices to print it was just faster and easier to put the printer on that L2. My wired devices that print - for example my PC or laptops that might be on other wireless networks like guest, etc. Just point directly to brother.local.lan for the printer that resolves to 192.168.2.50.

                                  But allowing print from my secured wifi (eap-tls) for my devices, and allowing to print on my guest might be useful I guess ;)

                                  The dns-sd should be possible to setup in unbound.

                                  I can setup the records from work.. But won't really be able to test until I get home and fire up ipad/iphone, etc.

                                  An intelligent man is sometimes forced to be drunk to spend time with his fools
                                  If you get confused: Listen to the Music Play
                                  Please don't Chat/PM me for help, unless mod related
                                  SG-4860 24.11 | Lab VMs 2.8, 24.11

                                  1 Reply Last reply Reply Quote 1
                                  • P
                                    papercutsupportdude
                                    last edited by

                                    @johnpoz

                                    Hi johnpoz,

                                    Printer discovery with PaperCut Mobility Print leverages the way that Apple devices natively discover printers on the network. It's meant to be zero-config for the end users, which means no entering IP addresses or server FQDNs for it to work. Admittedly, this means that there is a bit more work for the sysadmin to do though.

                                    The way this works is that macOS and iOS clients will look for two DNS records (b._dns-sd._udp and lb._dns-sd._udp) which we forward to an NS record (pc-printer-discovery). Whereas, Windows, Android, and Chrome devices running the Mobility Print client app will just look for the NS record. This NS record in turn can resolve to the hostname or IP address of the Mobility Print.

                                    I want to let you know that I'd be more than happy to do a remote session with you to see if there's a way to get this working with Unbound on PFSense. We've actually had few PFSense enthusiasts reach out to us to ask if we can help them, so it would be great to get a solution tested and documented.

                                    Let me know if this is something that you're interested in, or if there are any questions I can answer for you at all.

                                    1 Reply Last reply Reply Quote 0
                                    • johnpozJ
                                      johnpoz LAYER 8 Global Moderator
                                      last edited by johnpoz

                                      I don't really give 2 shits about your product... You should be reaching out to the OP that is having the hard time with this.. Not me ;)

                                      The questions you can answer is the simple easy to understand instructions for how to make it work with unbound.. If you have had a few pfsense users reach out to you - you would think you would already have this documented on your site..

                                      An intelligent man is sometimes forced to be drunk to spend time with his fools
                                      If you get confused: Listen to the Music Play
                                      Please don't Chat/PM me for help, unless mod related
                                      SG-4860 24.11 | Lab VMs 2.8, 24.11

                                      1 Reply Last reply Reply Quote 0
                                      • DerelictD
                                        Derelict LAYER 8 Netgate
                                        last edited by

                                        @papercutsupportdude said in Add PTR and NS Records to DNS Resolver possible?:

                                        The way this works is that macOS and iOS clients will look for two DNS records (b._dns-sd._udp and lb._dns-sd._udp) which we forward to an NS record (pc-printer-discovery). Whereas, Windows, Android, and Chrome devices running the Mobility Print client app will just look for the NS record.

                                        What, precisely, would a BIND zone file (or set of zone files) look like that accomplishes this?

                                        Chattanooga, Tennessee, USA
                                        A comprehensive network diagram is worth 10,000 words and 15 conference calls.
                                        DO NOT set a source address/port in a port forward or firewall rule unless you KNOW you need it!
                                        Do Not Chat For Help! NO_WAN_EGRESS(TM)

                                        1 Reply Last reply Reply Quote 0
                                        • johnpozJ
                                          johnpoz LAYER 8 Global Moderator
                                          last edited by johnpoz

                                          How you can do this is in that link I posted Derelict.. Most of all the docs I found are for bind which is running as authoritative for your zone.. But pretty sure you could get it working with unbound.

                                          I found the stuff that needs to go in to dns for my printer via avahi-browse.. But have not had time to translate it to record structure yet.. Is kind of PITA if you ask me - just easier to place the airprint on the same L2 as the devices wanting to use it, or just use avahi ;)

                                          So for example here is what you have to translate to TXT record...

                                          =   ens3 IPv4 Brother HL-3170CDW series                     Internet Printer     local
                                             hostname = [BRN30055C116AD9.local]
                                             address = [192.168.2.50]
                                             port = [631]
                                             txt = ["print_wfds=T" "UUID=e3248000-80ce-11db-8000-30055c116ad9"     "URF=SRGB24,W8,CP1,IS1-4,MT1-3-4-5-8-11,OB10,PQ4-5,RS600,DM1" "TBCP=F" "Transparent=T" "Binary=T" "PaperCustom=T" "Scan=F" "Duplex=T" "Copies=T" "Color=T" "usb_CMD=PJL,PCL,PCLXL,URF" "usb_MDL=HL-3170CDW series" "usb_MFG=Brother" "priority=25" "adminurl=http://BRN30055C116AD9.local./net/net/airprint.html" "product=(Brother HL-3170CDW series)" "ty=Brother HL-3170CDW series" "note=" "rp=ipp/print" "pdl=application/octet-stream,image/urf,image/pwg-raster" "qtotal=1" "txtvers=1"]
                                          

                                          There is some other records as well - like I said its kind of real PITA ;) If I ever get motivated enough I will put together some sort of run through. But you really need to be able to do the query directly to your printer so you know what it returns for devices on the local.. If you have the command dns-sd you can do a specific query that is suppose to come back in the bind syntax.. But haven't got that running on any of my linux boxes.. Think its more a bsd command. Closest thing is the avahi-browse.. Which you get stuff like this back

                                          user@uc:~$ avahi-browse --all
                                          +   ens3 IPv4 Brother HL-3170CDW series                     Web Site             local
                                          +   ens3 IPv4 Brother HL-3170CDW series                     Internet Printer     local
                                          +   ens3 IPv4 Brother HL-3170CDW series                     UNIX Printer         local
                                          +   ens3 IPv4 Brother HL-3170CDW series                     PDL Printer          local
                                          

                                          Then you can use the -r to find out what those actually return that you have to translate to actual dns records. So you need for sure those 2 PTR, then there is something that returns SRV and TXT, etc. But you have to set them up for your actual search domain vs what the browse comes back looking for .local I had a sniff I grabbed if my ipad finding it doing the mdns queries, etc.

                                          I haven't got up the drive yet to read the actual RFC ;) Since I never really have had any need for this.

                                          An intelligent man is sometimes forced to be drunk to spend time with his fools
                                          If you get confused: Listen to the Music Play
                                          Please don't Chat/PM me for help, unless mod related
                                          SG-4860 24.11 | Lab VMs 2.8, 24.11

                                          1 Reply Last reply Reply Quote 0
                                          • DerelictD
                                            Derelict LAYER 8 Netgate
                                            last edited by

                                            I am not in the mood to do a search/research on this. They should be able to provide example bind zone files. Those can then likely be converted to unbound.

                                            Chattanooga, Tennessee, USA
                                            A comprehensive network diagram is worth 10,000 words and 15 conference calls.
                                            DO NOT set a source address/port in a port forward or firewall rule unless you KNOW you need it!
                                            Do Not Chat For Help! NO_WAN_EGRESS(TM)

                                            P 1 Reply Last reply Reply Quote 0
                                            • First post
                                              Last post
                                            Copyright 2025 Rubicon Communications LLC (Netgate). All rights reserved.