Looks like no one’s replied in a while. To start the conversation again, simply ask a new question.

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

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

Posted on Apr 11, 2007 2:16 AM

Reply
12 replies

Apr 11, 2007 2:49 AM in response to Scott Mckenzie3

Not sure if it is relevant, but i've just been reading through a couple of other questions people have asked related to DNS etc...

I do have an entry in the etc/hosts file that was/is (i think, as it was in Windows) required for VPN access...

This is 192.168.100.2 ntserver

Where 192.168.100.2 is the IP of our server and ntserver is it's name (full server address is ntserver.blt.local)

Apr 11, 2007 9:22 AM in response to Scott Mckenzie3

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.

Apr 11, 2007 10:40 AM in response to Scott Mckenzie3

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?

Apr 11, 2007 10:41 AM in response to philsmith_

> 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).

Apr 11, 2007 11:24 AM in response to Camelot

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...

Apr 12, 2007 4:44 AM in response to BDAqua

Hi Phil (and others!)

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...

I did try and use different locations for work and home, but sadly i ended up with a spinning beach ball of doom when i tried to change the location at work, so it was a slightly pointless exercise!!!

The lookupd -configuration printout is as follows (no idea if it's useful in any way!)

ConfigSource: default
LookupOrder: Cache NI DS
MaxIdleServers: 4
MaxIdleThreads: 2
MaxThreads: 64
TimeToLive: 43200
Timeout: 30
ValidateCache: YES
ValidationLatency: 15
configname: Global Configuration

LookupOrder: Cache FF DNS NI DS
configname: Host Configuration

LookupOrder: Cache FF NI DS
configname: Service Configuration

LookupOrder: Cache FF NI DS
configname: Protocol Configuration

LookupOrder: Cache FF NI DS
configname: Rpc Configuration

TimeToLive: 60
ValidateCache: NO
configname: Group Configuration

TimeToLive: 300
ValidateCache: NO
configname: Initgroup Configuration

LookupOrder: Cache FF DNS NI DS
configname: Network Configuration

Thanks

Scott


MBP 2.0Ghz, 2Gb RAM, 100Gb 7200rpm Mac OS X (10.4.9) Parallels

Apr 12, 2007 8:56 AM in response to Scott Mckenzie3

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.

Apr 12, 2007 3:07 PM in response to philsmith_

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.

Apr 13, 2007 11:36 AM in response to Anthony Cunningham

Thanks Anthony, i think by doing the process at home i've sort of done that... and at present it still seems to be working, the USB hard drives have been mounting fine etc...

An odd problem, but seems to have been caused by the machine somehow "un-binding" itself at some point...

I'll keep my eye on it and see what happens!!!!

Thanks for the help and suggestions folks...

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

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple ID.