hemmes

Q: How do I create a TXT record?

I'm trying to figure out how to create a TXT record on OS X Server 4's DNS server.  Specifically for the Caching service's multiple public IP address requirements.  I'm, of course, using OS X Server's DNS implementation, but see no definitive method for creating TXT records.  I see there is a Text field for most record types, but usage is confusing at best.  Why would Apple choose not to implement TXT records, when this is a requirement of functionality for other supported services?  Not to mention, a good DNS implementation needs to have TXT record support.  Achieving this is trivial on Linux/Unix or Windows, but I can't even find reference to the BIND configuration file for Server 4, and it is no longer in the /var/named/ directory.

 

Also, if anyone can point me to any documentation covering these services in detail, that would also be appreciated.

 

 

 

 

 

  -- Mike

Mac mini, OS X Server, Yosemite, OS X Server 4.0

Posted on Jan 3, 2015 11:54 AM

Close

Q: How do I create a TXT record?

  • All replies
  • Helpful answers

Page 1 Next
  • by Alex Narvey,

    Alex Narvey Alex Narvey Jan 3, 2015 2:45 PM in response to hemmes
    Level 1 (4 points)
    Jan 3, 2015 2:45 PM in response to hemmes

    Strontium90 wrote a good answer for this in another string:

     

    https://discussions.apple.com/thread/5888316

     

    It describes Server.app 3 for Mavericks but the same applies for Server.app 4 in Yosemite.

  • by Michael Newbery,

    Michael Newbery Michael Newbery Jan 3, 2015 3:06 PM in response to hemmes
    Level 4 (2,424 points)
    Servers Enterprise
    Jan 3, 2015 3:06 PM in response to hemmes

    All (well, nearly al) of Server's files are in the /Library/Server directory. The BIND files are in /Library/Server/named.

     

    There is a file called /Library/Server/named/.version that says the BIND version (on Yosemite) is

    BIND 9.9.5 (Extended Support Version)

     

     

    If you want to add TXT to an entry that has an A record (or an AAAA record)

    • Select Show All Records from the settings menu at the bottom of the DNS pane.
    • Select the machine entry for the record you want to edit
    • Select Edit Record
    • Fill in the Text field
  • by hemmes,Solvedanswer

    hemmes hemmes Jan 3, 2015 7:07 PM in response to Michael Newbery
    Level 1 (4 points)
    Servers Enterprise
    Jan 3, 2015 7:07 PM in response to Michael Newbery

    Thanks for the reply,


    I actually found the "named" directory just before reading this, and was able to edit the respective zone file, like a standard BIND configuration file.  I understand that Server.app will create a TXT record using the inheritance of the A record label, when using the Text field of the new A record dialog box.  However, this will not suffice if you need to create a TXT record starting with an underscore (_), as is required by Apple's own Caching service, when using different public IPs for clients.  Go ahead and try to make a TXT record entry for "_aaplcache._tcp", with the Server.app GUI and let me know how it goes...I'll answer that for you; "Not well, Mike."  This could likely function correctly if Apple implemented RFC 2181, in Server.app's GUI.  This expands the character set allowed for DNS names, stating that any binary string may be utilized for DNS labels.  Luckily, Apple implements BIND correctly, and serves the TXT entry when queried.  It also appears to leave the zone file intact when modifying other entries with the GUI.  The Server.app GUI does not parse the manually created TXT record however, and thus must be modified and maintained by hand.



      -- Mike

  • by hemmes,

    hemmes hemmes Jan 3, 2015 7:10 PM in response to Alex Narvey
    Level 1 (4 points)
    Servers Enterprise
    Jan 3, 2015 7:10 PM in response to Alex Narvey

    Thanks for the reply Alex, see my response to Mr. Newbery..

  • by simon@ifoam,

    simon@ifoam simon@ifoam Nov 11, 2015 6:57 AM in response to hemmes
    Level 1 (9 points)
    Nov 11, 2015 6:57 AM in response to hemmes

    Thank you for the explanation, but I still don't see what I have to do exactly where to make the TXT entry with underscore work.

     

    I am trying to set up Caching Server for our two load balanced lines according to this great article: http://blog.fraserhess.com/2014/10/caching-server-enterprise-edition.html

    unfortunately the DNS part is shown for Windows Server where it seems to work. In my case the DNS is provided by the same Server.app that also runs the Caching Server. As hemmes said the Server.app GUI refuses the underscore, but I am missing the information how and where to modify this manually...

    Can anybody help?

  • by hemmes,

    hemmes hemmes Nov 11, 2015 7:08 AM in response to simon@ifoam
    Level 1 (4 points)
    Servers Enterprise
    Nov 11, 2015 7:08 AM in response to simon@ifoam

    HI Simon,

            I'm out and about at the moment, but will explain in detail when I'm back at my office later today.

     

      -- Mike

  • by simon@ifoam,

    simon@ifoam simon@ifoam Nov 11, 2015 11:10 PM in response to hemmes
    Level 1 (9 points)
    Nov 11, 2015 11:10 PM in response to hemmes

    thank you Mike, I would be very grateful

  • by hemmes,

    hemmes hemmes Nov 12, 2015 2:52 AM in response to simon@ifoam
    Level 1 (4 points)
    Servers Enterprise
    Nov 12, 2015 2:52 AM in response to simon@ifoam

    Sorry, got back late!  Will definitely get to it tonight.  Do you have any experience with the VI editor?

     

      -- Mike

  • by simon@ifoam,

    simon@ifoam simon@ifoam Nov 13, 2015 1:05 AM in response to hemmes
    Level 1 (9 points)
    Nov 13, 2015 1:05 AM in response to hemmes

    I prefer nano, but can also handle vi a bit. At least I know how to :q

     

    No seriously, I am very familiar with the command line but I hardly had to do with DNS setup further than setting A or MX records through different GUI.

  • by John Lockwood,

    John Lockwood John Lockwood Nov 13, 2015 2:18 AM in response to simon@ifoam
    Level 6 (9,155 points)
    Servers Enterprise
    Nov 13, 2015 2:18 AM in response to simon@ifoam

    simon@ifoam wrote:

     

    I prefer nano, but can also handle vi a bit. At least I know how to :q

     

    No seriously, I am very familiar with the command line but I hardly had to do with DNS setup further than setting A or MX records through different GUI.

     

    If your familiar with the command line then adding a TXT record, even one beginning with an underscore would simply be a matter of inserting a line similar to the following

     

    _domainkey.domain.com.               10800 IN TXT      "t=y; o=~; r=postmaster@domain.com"
    
    
    

     

    this needs to go in to -

     

    /Library/Server/settings/named/db.domain.com

     

    where db.domain.com will be the file corresponding to the domain name aka. zone name you have defined in Server.app.

     

    Note: As should be obvious the example above is not for Apple's Caching server but rather for use with DomainKeys. You just need to put your requirements in the corresponding places.

  • by simon@ifoam,

    simon@ifoam simon@ifoam Nov 13, 2015 8:02 AM in response to John Lockwood
    Level 1 (9 points)
    Nov 13, 2015 8:02 AM in response to John Lockwood

    Thank you very much. It works to set up the TXT entry like that, but as it absolutely didn't want to work I dug deeper and it seems I am in a scenario which still is not supported:

     

    Multiple public IP addresses and NAT.

     

    Another person came to the same conclusion here:Re: Use caching server with multiple public Addresses?

     

    I found out that these help pages actually describe what I was asking for in the first place.

    http://help.apple.com/serverapp/mac/5.0/#/apdC36C9994-1533-4DCB-9CFF-870CB0FADCD B

    http://help.apple.com/serverapp/mac/5.0/#/apd6015d9573

    I noticed later the headline "DNS settings for caching without a NAT" in the second article

  • by John Lockwood,

    John Lockwood John Lockwood Nov 13, 2015 9:05 AM in response to simon@ifoam
    Level 6 (9,155 points)
    Servers Enterprise
    Nov 13, 2015 9:05 AM in response to simon@ifoam

    As far as I am aware the ability to use multiple public IP addresses was added in Server 4.x i.e. Yosemite. As I understand it this basically boils down to creating a TXT record which defines the multiple public IP addresses that client Macs might connect to the Internet via and for which you want your single caching server to respond.

     

    See http://blog.fraserhess.com/2014/10/caching-server-enterprise-edition.html

     

    I do not see NAT being a problem, not using NAT would be more of a problem which is why that is specifically discussed in the Apple articles you linked to.

     

    A possible real world scenario might be a company using multiple bonded Internet links - each has its own public IP address but all are 'bonded' in to one link as far as your LAN is concerned. Therefore your LAN is a single NATed range using multiple public IP addresses. The Apple caching server would be on the same LAN and like the clients could go out to the Internet via any of those public IP addresses - hence the need to define a TXT record to say which ones it is responsible for.

     

    So depending on what and how many public IP addresses the following is a possible example I believe should suit you.

     

    _aaplcache._tcp 259200 IN TXT "prs=65.125.164.33-65.125.164.44"

    or

    _aaplcache._tcp 259200 IN TXT "prs=65.125.164.33,65.125.164.44"


    The first does a range of IP addresses, the second example does two individual IP addresses.

  • by simon@ifoam,

    simon@ifoam simon@ifoam Nov 13, 2015 9:33 AM in response to John Lockwood
    Level 1 (9 points)
    Nov 13, 2015 9:33 AM in response to John Lockwood

    Thank you again for the explanation. I also thought it should still work, but I can't get it to work. Of course I restarted DNS service to apply changes.

     

    The remaining thing I can think of now is this from the help article:

    The DNS TXT record needs to be added to the zone that:

    • Is authoritative for the domain
    • Matches the default search domain for network clients

    First of all I want to underline that I am not a DNS expert. I'm just trying to describe the situation as I see it.

    The OS X Server with DNS and Caching Server is #1 used by the clients, but they don't have a search domain set.

    Our server manages a couple of internal .dev domains and apart from that has a zone which corresponds to the server's own hostname. The latter I thought would be the right one to add the TXT record.

    However after doing so nothing changes on the client computers. AppStore downloads which surely are in the Cache are requested from the internet.

    I tried setting the search domain on the client computer (to xxx.company.org which corresponds to the zone I have modified). Cleared clients DNS cache. No change.

    I monitored from a client computer with tcpdump what DNS request are being sent when e.g. starting iMovie download in AppStore, but I don't even see anything related to _applcache._tcp

    Maybe my scenario really is a problem for the caching service? Sorry for hijacking this thread. First I thought it's closely related, now it seems I might be in a very unusual situation.

  • by hemmes,

    hemmes hemmes Nov 13, 2015 9:54 AM in response to simon@ifoam
    Level 1 (4 points)
    Servers Enterprise
    Nov 13, 2015 9:54 AM in response to simon@ifoam

    Hi Simon,

         Sorry I was so busy the past couple of days.  What John detailed is correct, except the directory is now /Library/Server/named in Server 5 (not sure if it was different in previous versions).  I also have multiple public IPs, my server is behind a static NAT configuration, with the clients configured to a different NAT'd IP, on the same router, but that really shouldn't matter.  You need to open up the Server Manager, click Caching, then click Edit Permissions, and change the "Serve clients with public addresses:" setting to "on other networks."  Then you'll need to add those public IP spaces to the list by clicking the + button.  You can enter a range or just the starting IP for a single address.  Then click the Client Configuration... button, leave BIND selected, and literally copy and paste that text into a new line in your db.domain.com file in the /Library/Server/named directory.

     

    Screen Shot 2015-11-13 at 12.02.56 PM.png

     

    Could you provide more info on your setup?  Are you using multiple subnets, routers, etc; what's your topology look like?

Page 1 Next