Articles May 8, 2006 at 2:51 pm

kbase: Mac OS X Server 10.4.6: Changes in Server Hostname Discovery and changeip

Worth pointing out, since it contradicts what some people have said in the past.

http://docs.info.apple.com/article.html?artnum=303697

No Comments

  • Yeah, some people would include me. But until the behavior change in 10.4.6,
    the most proper place to set the FQDN was in etc/hostconfig.

    I’m just glad to see that Apple:

    A) Has straightened it all out
    and
    B) has documented it.


    Breaking my server to save yours.

    Josh Wisenbaker
    http://www.afp548.com

    • I think I might continue the hardcoding. Just to be difficult.

      Although I’m still very much of the opinion that for a server this stuff isn’t really
      supposed to be dynamic. However, it does seem that they have taken some care
      to ensure that it’s mostly dynamic only when it should be.


      Changing the world, one server at a time.

      Joel Rennich
      http://www.afp548.com

      • In the KDB they emphasis that we should not hardcode the HOSTNAME
        variable.
        What would happen if I do it like you?
        Because for me I continiously got a error like they described:
        "server1.ex.com != server2.ex.com"

        • Depending on how the tests go I might continue to hardcode in /etc/
          hostconfig as well. I know that before this /etc/hostconfig overrode the scutil
          settings. Now things seem to be more server specific as they have modified
          changeip and say nothing about scutil.

          The problem is that the dynamic config store is dynamic. Changes in DNS
          could then effect your server in a greater way.


          Breaking my server to save yours.

          Josh Wisenbaker
          http://www.afp548.com

    • Yeah I just had an issue with this,I installed a blank non-setup copy of 10.4
      server and then updated it 10.4.6 passively.I then rebooted with correct DNS
      and ran through the server setup applying an ip,new admin,root passwd etc.

      rebooted and found that I had a .local address for my hostname.my DNS
      server was configured correcly in the System Preferences and I could resolve
      my host name (A and PTR) I checked netstat and having only one connection I
      did have the correct ip.

      I tried setting the hostname in /etc/hostconfig and that worked as
      expected,but I was more concerned about what I thought was going on, so I
      removed it.In looking around server admin I noticed posix hostname was set
      to a PTR record for one of my DHCP addresses which the server would have
      had before I setup its ip config.

      I deleted the /Library/Preferences/SystemConfiguration/preferences.plist
      which is where I belive this new feature is suppose store the cached
      name,rebooted reset up my Sharing and Network and now my hostname was
      right.Soooo,I think what happended is it cached my dhcp hostname and then
      was feeding from that cache even after I setup the network config and correct
      IP(even through reboots,which is what the article sounds like).
      Anybody else seen this?

  • I wrote this up for my own website, but it bears repeating here:

    Just a little perspective from someone who was responsible for finding the bug in the first place and worked with some of the engineers who actually fixed it. I originally found the bug in the 10.4.3 timeframe, and there was actually a fix coded up for it by the 10.4.4 timeframe. However, Apple’s engineering department considered this a significant change to functionality, and so insisted on doing heavy duty QA on the fix before it was released in 10.4.6. This was the right thing to do, in my opinion.

    The issue goes back to MOSXS 10.3, when the server hostname was hard-coded in the /etc/hostconfig file, based on what the administrator entered in the Server Setup Assistant. The problem is that some relatively high minority of inexperienced administrators would either put in just the hostname instead of the fully-qualified hostname (e.g. "myserver" instead of "myserver.example.com"), or they would have a typo in the hostname. This would then be propagated through the Server Setup Assistant into various config files on the system.

    To avoid this, in 10.4 Apple went to retrieving the server’s fully qualified hostname from a reverse DNS lookup at boot time. The thinking was that the administrator only had to get the DNS entry right, and not re-enter the same information as a part of the server setup. However, this ran into a few problems as well. It does not work if: 1) the network didn’t have full reverse DNS lookup, such as with a low-end SOHO router; 2) The DNS server is a little bit slow with its response (which can happen if the network switch is slow to autonegotiate the connection speed); or 3) the server is hosting its own DNS server, since the hostname lookup happens very early on in the boot process but the named daemon starts up much later. In any of these cases, the server fell back on the mDNS/Bonjour name of the server.

    To get around this, there were two fixes — one technical, one procedural. The technical fix was to let the named daemon signal to the operating system that it had started up, allowing the operating system to re-check the hostname — this takes care of (3). The procedural one was to hard code the hostname in the /Library/Preferences/SystemConfiguration/preferences.plist file by using the command:

    sudo scutil –set HostName servername.example.com

    as documented in the kbase article:

    http://docs.info.apple.com/article.html?artnum=302044.

    This process is automated by the changes in Server Update 10.4.6, referred to in kbase article:

    http://docs.info.apple.com/article.html?artnum=303697

    In addition, the operating system now checks for a mismatched stored hostname vs. the reverse DNS result, and complains in system.log if there is a problem.

    The point of all of this? Don’t edit /etc/hostconfig any more, and make ABSOLUTELY SURE that your Mac OS X Server has proper forward and reverse DNS resolution on its primary IP address.


    Paul Suh http://www.ps-enable.com/
    [email protected] (301) 643-1516

    • Thanks Paul for your clarification on the why? question.
      However, what’s wrong with entering the FQDN in /etc/hostconfig?
      If I were Apple I should not change procedures because some (stupid)
      sysadmins cannot type the hostname/FQDN correctly.
      IP numbers and hostnames are not supposed to be dynamic on a server.
      The 10.3.x way was clearer to me than the 10.4.6 way.

    • Hi,

      I would add to this that apple have still not got it 100% right. Where the dns server responds to the reverse lookup in this format:

      nn.nn.nn.nn.in-addr.arpa. 86400 IN CNAME nn.nn-nnn.nn.nn.nn.in-addr.arpa.
      nn.nn-nnn.nn.nn.nn.in-addr.arpa. 38400 IN PTR server.mydomain.com.

      It say that:

      Aug 1 06:00:41 server servermgrd: servermgr_dns: more than one name for the primary IP address, unable to pick one
      Aug 1 06:00:41 server servermgrd: servermgr_dns: no reverse DNS entry for server, various services may not function properly

      Very annoying as there seems to be no easy fix.

      Tim

  • Joel,

    if you want to make sure it’s statically set, you should use /etc/hosts instead of /etc/hostconfig.

    Dean Shavit, Mac Tech Magazine
    author of Mac HelpMate
    http://www.macworkshops.com/machelpmate

Leave a reply

You must be logged in to post a comment.