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 37.1k Views 8 Watching
    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.
    • P Offline
      papercutsupportdude @johnpoz
      last edited by

      @johnpoz
      About putting together a guide showing how to point clients to a AirPrint printer in another subnet, that would be really cool actually. I've been wanting to try this out for awhile, but haven't got around to it.

      To clarify a few points about the DNS records:

      • print-server-hostname could be the hostname of your Mobility Print server, or it can literally just be an A record "print-server-hostname" so long as it points towards the IP address of the server running the Mobility Print software.
      • b._dns-sd._udp.domain.tld would not be the correct record. I'm not a BIND expert, so I can't really explain how this works that well. I just know firsthand that the PTR record should be b._dns-sd._udp and the client should supply the DNS search suffix.

      I definitely agree that the records are not typical. It's not something we invented, but we're just leveraging the way that Apple devices natively discover services on the network. It definitely is a bit unusual.

      Let me know if that makes a bit more sense.

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

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

        b._dns-sd._udp.domain.tld would not be the correct record

        yes it would be.. If the clients search suffix is domain.tld... The client is not going to do a search for just b._dns-sd._udp

        b._dns-sd._udp IN PTR @ ; b = browse domain
        lb._dns-sd._udp IN PTR @ ; lb = legacy browse domain

        Its going to do do a search for that with its default domain suffix.

        This is what it says here
        http://www.dns-sd.org/serverstaticsetup.html

        How it Works

        Now that you’ve created your DNS records, the process works like this:

        When a client gets an address from your DHCP server, your DHCP server also includes information specifying a default DNS domain. In this example, we’ll assume that’s “example.com.”

        The client needs to determine whether you’d like it to use Wide-Area DNS-SD to browse for services. It does this by prepending the text “lb._dns-sd._udp” to the default DNS domain, and then doing a query for PTR records with that name (in this case “lb._dns-sd._udp.example.com.”).

        In our example the client’s query gets an answer: “example.com.” In principle the PTR record could indicate some other domain to browse instead, but in the common case a self-referential PTR referring back to the same domain is usually easiest.

        The client now knows it’s supposed to browse for services in “example.com.” Any time an application like the Safari web browser calls one of the DNS-SD browsing APIs to browse for services, without explicitly specifying a particular DNS domain to browse, the mdnsd daemon will automatically browse the default browse domain it learned from the network.

        Simple enough to sniff and see what a client does a query for..

        From your own sites instructions
        0_1532369121874_commands.png

        What do you think that command is doing... Its creating a PTR for the FQDN b._dns-sd._udp.papercutsoftware.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 25.07 | Lab VMs 2.8, 25.07

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

          Well what do you know ;) It can find the printer with just a few records..

          0_1532401679078_unbound-airprint.png

          The plex.direct is not part of it.. But the other records are.. So it finds the printer and lists it. But when I try and print to it says offline. I opened all ports to the printer IP.. But I don't see the ipad actually trying to send any printer traffic. It looks to be trying to do some sort NAT-PMP.. Its asking pfsense to nat some ports, asks for its external IP, etc.

          But pretty sure that is NOT related..

          Gawd Damit ;) Going to have to read the freaking RFC I take it... This is a billion times more than I ever wanted to know about stupid ass airprint ;)

          Simple enough to create the records in unbound that is for sure.. As you see above.. You can get the info for the SRV and TXT records with avahi-browse.. So it finds printers, and yeah I was right about the domain.tld having to be there - that is what it queries for.. See here

          0_1532404034161_dnsqueries.png

          I knew I had the simple solution when I just put my printer on the L2 my wireless vlan that I would want to airprint from ;)

          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 25.07 | Lab VMs 2.8, 25.07

          1 Reply Last reply Reply Quote 0
          • M Offline
            Margio
            last edited by

            @johnpoz Isn’t the syntax for the TXT record in Unbound as described in this article
            I’m not an expert and maybe i’m wrong but i just wanted to give my two cents after an entire aftertnoon spent searching for a solution (i’m on the way home so i’ll try your code later but i’m optimistic).

            Thank you anyway.

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

              I don't think it had a problem with my TXT settings... Might have to do a single ' outside the double '' - maybe.. I don't know I didn't care enough to dive any deeper into to be honest.

              Just run your freaking airprint server on the same L2 you need to use it ;) Or use a simple printer server that supports airprint would be my solution..

              But sure if you can get it to work because I did some typo or something - sure please post to help the next guy.

              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 25.07 | Lab VMs 2.8, 25.07

              1 Reply Last reply Reply Quote 0
              • H Offline
                hazartilirot
                last edited by hazartilirot

                I've read the whole article and am quite confused. Has anyone succeeded in setting up the DNS?

                I've installed BIND9 on Windows 7,

                forward.bind

                $TTL	3h
                @	IN	SOA	example.local. root.example.local. (
                          1		; Serial
                        3h		; Refresh
                        1h		; Retry
                	1w		; Expire
                	1h )	; Negative Cache TTL
                	
                b._dns-sd._udp       IN PTR pc-printer-discovery
                lb._dns-sd._udp      IN PTR pc-printer-discovery
                pc-printer-discovery IN NS  print-server
                print-server    IN A   192.168.10.4 ; Mobility Print server
                
                ;
                @   IN NS example.local.
                example.local. IN A 192.168.10.252 ; DNS SERVER
                

                named.conf

                options {
                  directory "C:\Program Files\ISC BIND 9\etc";
                  listen-on { 192.168.10.252; 127.0.0.1; };
                  forwarders {
                      8.8.8.8; 
                      8.8.4.4; 
                  };
                  dnssec-enable yes;
                  dnssec-validation yes;
                  dnssec-must-be-secure pc-printer-discovery no;
                };
                logging {
                	channel my_log {
                	 file "named.log" versions 3 size 1m;
                	 severity debug;
                	 print-severity yes;
                	};
                    category default {
                	 my_log;
                	};
                };	 
                 zone "10.168.192.in-addr.arpa" {
                    type master;
                    file "C:\Program Files\ISC BIND 9\etc\reverse.10.168.192.bind";
                    notify no;
                 };
                  zone "20.168.192.in-addr.arpa" {
                    type master;
                    file "C:\Program Files\ISC BIND 9\etc\reverse.20.168.192.bind";
                    notify no;
                 };
                 zone "example.local" {
                    type master;
                    file "C:\Program Files\ISC BIND 9\etc\forward.bind";
                 };
                 zone "pc-printer-discovery" {
                     type forward;
                     forward only;
                     forwarders { 192.168.10.252; };
                };
                

                and two reverse files alike

                $TTL	3h
                @	IN	SOA	example.local. root.example.local. (
                        1		; Serial
                        3h		; Refresh
                        1h		; Retry
                	1w		; Expire
                	1h )	; Negative Cache TTL
                ;
                @	IN	 NS	    example.local.
                4       IN      PTR     PRINT-SERVER.
                
                b._dns-sd._udp       IN PTR 0.10.168.192.pc-printer-discovery. ; 0.20.168.192
                lb._dns-sd._udp      IN PTR 0.10.168.192.pc-printer-discovery.  ; 0.20.168.192
                

                On my DNS Server, I set DNS 192.168.10.252, 127.0.0.1; 8.8.8.8
                I do see DNS suffix example.local

                I even went further and set DHCP option 119 on my router.
                Disabled all firewalls.

                I don't get even one bloody green tick! What's the heck?

                C:\Program Files\ISC BIND 9\bin>nslookup pc-printer-discovery.example.local
                Server:         192.168.10.252
                Address:        192.168.10.252#53
                ** server can't find pc-printer-discovery.example.local: NXDOMAIN
                

                The last idea came to my mind is to separate Mobility Print Server and DNS Server - they are split apart and working on different PCs.

                I get JSON when I request
                http://print-server:9163/printers or
                http://192.168.10.4:9163/printers

                That's it.

                My apologies for a silly question, I'm not an administrator and not quite close to be in the future, however could it happen with me because I use .local ?
                And another question: Should a domain name for those records be the same as I use for ADDC ? I wish I knew it before I set up ADDC. We've got an external domain and today I would rather set up our inner domain as a subdomain of the external one.

                Any help would appreciated! Thank you in advanced!

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

                  Been a while since I looked at this - and that was trying to get it to work with unbound and not bind.. They have a template you should just be able to load up in bind from that mobility print stuff.

                  There was a guy from mobility print that was suppose to get back to me, he never did.

                  I guess I could give this another go with bind.. But to be honest there shit is pretty broken if you ask me.. Creating records that resolve are not a problem, its how their shit software works from what I recall.

                  But you calling up an IP or host name, print-server not even fully qualified so you didn't get that from dns even a port via http has really little to do with airprint and dns across L2s.

                  If you have dns running on something other than pfsense, then this has nothing to with pfsense at all, even if using on it bind or unbound. Not really pfsense questions - but how to use a software package bind or unbound that is just running on pfsense.. which could be running on anything at all.

                  I would suggest you get with them on support on getting it to work with your bind server... Then once you have a working zone file.. More than happy to help you get that zone file on the bind package in pfsense, or get it working in unbound. Unbound is more than capable of serving up any sort of record you want to serve up.

                  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 25.07 | Lab VMs 2.8, 25.07

                  1 Reply Last reply Reply Quote 0
                  • H Offline
                    hazartilirot
                    last edited by

                    I've been chatting to Papercut's support for a month I think.... I've thrown my Asus AC68U to bin and bought Mikrotik RB4011iGS+5HacQ2HnD-IN to get more flexibility in settings.

                    I created DNS records on my QNAP (used as ADDC), then I installed BIND on Docker, then I took all things home, installed BIND9 on Windows 7 and playing with everything all day long.

                    Mikrotik isn't a home router though I googled a lot and learnt how to set up a basic configuration.

                    This thing just drives me mad.... since I don't know how, what, and why?

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

                      A month?? heheheh Yeah it should be tops a few minute conversation - to be honest I don't think they know how to make it work either ;)

                      If I am recalling correctly their software wasn't even doing the proper queries anyway.. If I get bored latter I might fire this up again.. in general dns-sd is not all that complex... But I don't think their software works how they think it does to be honest..

                      It should do a PTR query, which I never saw it actually do.. If I am recalling this correctly.. This was back couple years now..

                      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 25.07 | Lab VMs 2.8, 25.07

                      S 1 Reply Last reply Reply Quote 1
                      • S Offline
                        stickb0y7 @johnpoz
                        last edited by

                        Sorry for bringing back a 4 year old thread, but I think I got this working for me in OPNSense using Unbound and I wanted to update the thread with a solution in case anyone else is looking. This is the only useful result that comes up when searching for making Mobility Print work with Unbound.

                        This hint about using typetransparent seems to make it work without doing anything else special. I set that through the GUI in OPNSense but I believe the relevant config line it results in is:

                        local-zone: "mydomain" typetransparent
                        

                        I think these are the other relevant parts of the config files - in OPNSense I created a custom config file to add the entries as they removed the "advanced" box on the current release. (the OPNSense config file has a include: /var/unbound/etc/*.conf where custom entries go)

                        root@OPNsense:/var/unbound/etc # cat mobilityprint.conf
                        server:
                          local-data: "b._dns-sd._udp.mydomain IN PTR pc-printer-discovery.mydomain"
                          local-data: "lb._dns-sd._udp.mydomain IN PTR pc-printer-discovery.mydomain"
                          local-data: "pc-printer-discovery.mydomain IN NS lxc-print.mydomain"
                        

                        I didn't add the A record here, since I have a static DHCP lease for my Mobility Print server called lxc-print, but that record is just:

                        local-data: "lxc-print.mydomain IN A 10.10.5.17"
                        

                        Everything passes in the Mobility Print DNS setup page and I get the correct results from nslookup:

                        lvm-debian-1:~> nslookup -query=ptr b._dns-sd._udp.mydomain
                        Server:         10.10.0.2
                        Address:        10.10.0.2#53
                        
                        b._dns-sd._udp.mydomain     name = pc-printer-discovery.mydomain.
                        
                        lvm-debian-1:~> nslookup -query=ptr lb._dns-sd._udp.mydomain
                        Server:         10.10.0.2
                        Address:        10.10.0.2#53
                        
                        lb._dns-sd._udp.mydomain    name = pc-printer-discovery.mydomain.
                        
                        lvm-debian-1:~> nslookup -query=ns pc-printer-discovery.mydomain
                        Server:         10.10.0.2
                        Address:        10.10.0.2#53
                        
                        pc-printer-discovery.mydomain       nameserver = lxc-print.mydomain.
                        
                        lvm-debian-1:~> nslookup lxc-print.mydomain
                        Server:         10.10.0.2
                        Address:        10.10.0.2#53
                        
                        Non-authoritative answer:
                        Name:   lxc-print.mydomain
                        Address: 10.10.5.17
                        
                        1 Reply Last reply Reply Quote 1
                        • First post
                          Last post
                        Copyright 2025 Rubicon Communications LLC (Netgate). All rights reserved.