Skip navigation
This discussion is archived

Configure DNS & Search Domains in TCP/IP Settings via Terminal?

558 Views 12 Replies Latest reply: Apr 13, 2007 12:42 PM by philsmith_dot_com RSS
Scott Mckenzie3 Calculating status...
Currently Being Moderated
Apr 11, 2007 2:16 AM
HI Folks,

I've been having a long standing battle trying to find out what is wrong with my machine, it's been running like a dog for a while and having recently added 2 new Macs to our network i recall that there was a setting missing - namely within the TCP/IP settings for the Built In Ethernet, the DNS Servers and Search Domains are not configured on my machine, but are on the new ones i've added (mine was my new foray into Macs so i maybe set it up wrong!)

However the main problem occurs when i try to edit the settings for the above from within System Preferences -> Network, i get a spinning beach ball of doom and have to Force Quit. Yet oddly i can access the setting fine when i am at home and not connected to the AD of the Windows Server Environment... which makes me think the events could be linked.... i thought it may have been Parallels and it's NAT settings, but given that all works perfectly at home i'm not so sure. Hence, as a process of elimination i'd like to try and get the correct settings for Search Domain etc to see if it helps, before i flatten the machine and reinstall Tiger completely!

The main issues i've been having with the machine can be found here:

http://discussions.apple.com/thread.jspa?threadID=854009&tstart=0

Thanks

Scott


MBP 2.0Ghz, 2Gb RAM, 100Gb 7200rpm   Mac OS X (10.4.9)   Parallels
  • philsmith_dot_com Calculating status...
    However the main problem occurs when i try to edit
    the settings for the above from within System
    Preferences -> Network, i get a spinning beach ball
    of doom and have to Force Quit.


    Yes, you can change your DNS settings manually. The place to start is by modifying the file /etc/resolv.conf. When you put in a DNS server with System Preferences, this is the file that gets modified. The first line should be "domain local". Any search domains and the rest should be "nameserver IP.ad.re.ss".

    You can avoid the whole lookup thing by putting entries in /etc/hosts. But DNS was designed as a way to avoid copying /etc/hosts all over the net. And I could be wrong, anyway. You need to check your lookupd configuration. Enter "lookupd -configuration" and look for the host configuration. It will list the order in which things are checked. By default, the Flat File (FF) agent is checked before DNS, but that can be changed. Of course, the cache should always be checked first.

    I'm going to look at your other post now. Sounds like you've been having a lot of trouble.
    Powerbook G4, iMac (Intel), and tons of hardware sitting in the closet, Mac OS X (10.4.9)
  • philsmith_dot_com Level 3 Level 3 (830 points)
    I read your other post - wow, what a mess! It sounds to me like a problem with launchd and AD. One of the criticisms of launchd is that it does too much. In the days of init and rc startup was divided into groups of tasks. Now launchd handles everything but only on demand. It sounds like a circular dependency - like A depends upon B, B depends upon C, but C depends upon A.

    Are you using different Locations for home and work?
    Powerbook G4, iMac (Intel), and tons of hardware sitting in the closet, Mac OS X (10.4.9)
  • Camelot Level 8 Level 8 (45,670 points)
    > The place to start is by modifying the file /etc/resolv.conf

    Actually, that's not correct. The place to end is /etc/resolv.conf.

    While this approach will work, the OS rewrites /etc/resolv.conf each time the network changes (e.g. you reboot, change network locations, etc.), so any changes you make there are only temporary. It might be enough to overcome your problem, but it's not the best way.

    The recommend way is via the command line utility networksetup which provides access to all network preferences. The specific command you want will be something like:

    <pre class=command>sudo networksetup -setdnsservers "Built-in Ethernet" 1.2.3.4 99.88.77.66</pre>

    Where 'Built-in Ethernet' is the name of the interface settings (as per System Preferences -> Network), and '1.2.3.4 9.88.77.66' represents the IP addresses of two DNS servers to use (adjust as appropriate).
    Mac OS X (10.4.8)
  • philsmith_dot_com Level 3 Level 3 (830 points)
    While this approach will work, the OS rewrites
    /etc/resolv.conf each time the network changes (e.g.
    you reboot, change network locations, etc.), so any
    changes you make there are only temporary. It might
    be enough to overcome your problem, but it's not the
    best way.


    Mine seems to be persistent. I did notice it's a symlink to /var/run/resolv.conf, but the contents remain the same after rebooting.

    The recommend way is via the command line utility
    networksetup which provides access to all
    network preferences.


    I like that. I found it in /System/Library and made a symlink from /usr/sbin. I'm going to spend some time looking at it. For something that's the recommended way, it sure was hard to find. Inside something called ARDAgent.app, in the Support directory. Also, there's systemsetup. Is that a recommended way to acceess system preferences?

    Thanks for the info. Now if I could only figure out what an ARD is...
    Powerbook G4, iMac (Intel), and tons of hardware sitting in the closet, Mac OS X (10.4.9)
  • BDAqua Level 10 Level 10 (114,670 points)
    ARD=Apple Remote Destop I think.
  • philsmith_dot_com Level 3 Level 3 (830 points)
    Hi Phil (and others!)


    Hi Scott!

    I opted for the easy choice, which did work... and
    have added the Search Domain info etc whilst at
    home... and touch wood today things seem to be
    working better, i can easily access network
    preferences etc and have had no hanging apps as
    yet...


    Let's see. It certainly is beginning to sound like circular dependencies.

    The lookupd -configuration printout is as follows (no
    idea if it's useful in any way!)
    LookupOrder: Cache FF DNS NI DS
    configname: Host Configuration


    That just says that the resolver will look to the cache first, then the flat files (/etc/hosts, etc.), then DNS, then NetInfo, then Directory Access. It's normal.

    Interesting problem.
    Powerbook G4, iMac (Intel), and tons of hardware sitting in the closet, Mac OS X (10.4.9)
  • Anthony Cunningham Level 3 Level 3 (625 points)
    Well i realize oure already in to this so i dont know where you stand at the moment. But the first thing i would do is un bind that machine from the active directory. Then youse local machine account to edit preferences. Not a network account. When youre done then bind the machine back to AD again and set it up like you did the machines that are working well at the moment. There may be something going on here thats deeper than this but its hard to say if we dont even know whats screwing up for sure.
    G4 Quick Silver 2001 800 Mhz, Mac OS X (10.4.7)
  • philsmith_dot_com Level 3 Level 3 (830 points)
    It might be that you're calling netinfo to bind to AD, but netinfo needs to do a name lookup to find it. Before .local was added to the DNS search domains, DNS would fail. Then your resolver would go to the next item in the list. That would be netinfo, which might be currently blocked waiting for an address. Deadlock.
    Powerbook G4, iMac (Intel), and tons of hardware sitting in the closet, Mac OS X (10.4.9)

Actions

More Like This

  • Retrieving data ...

Bookmarked By (0)

Legend

  • This solved my question - 10 points
  • This helped me - 5 points
This site contains user submitted content, comments and opinions and is for informational purposes only. Apple disclaims any and all liability for the acts, omissions and conduct of any third parties in connection with or related to your use of the site. All postings and use of the content on this site are subject to the Apple Support Communities Terms of Use.