<p>From time to time am I working in a completely disconnected environment with a Macbook Pro. For testing purposes I need to run a local DNS server in a VMWare session. I've configured the lookup system to use the DNS server (/etc/resolve.conf and through the network configuration panel, which is using configd underneath), and commands like "dig" and "nslookup" work. For example, my DNS server is configured to resolve www.example.com to 127.0.0.1, this is the output of "dig www.example.com":</p>

<pre><code>; &lt;&lt;&gt;&gt; DiG 9.3.5-P1 &lt;&lt;&gt;&gt; www.example.com
;; global options:  printcmd
;; Got answer:
;; -&gt;&gt;HEADER&lt;&lt;- opcode: QUERY, status: NOERROR, id: 64859
;; flags: qr aa rd; QUERY: 1, ANSWER: 1, AUTHORITY: 0, ADDITIONAL: 0

;; QUESTION SECTION:
;www.example.com.               IN      A

;; ANSWER SECTION:
www.example.com.        86400   IN      A       127.0.0.1

;; Query time: 2 msec
;; SERVER: 172.16.35.131#53(172.16.35.131)
;; WHEN: Mon Sep 15 21:13:15 2008
;; MSG SIZE  rcvd: 49
</code></pre>

<p>Unfortunately, if I try to ping or setup a connection in a browser, the DNS name is not resolved. This is the output of "ping www.example.com":</p>

<pre><code>ping: cannot resolve www.example.com: Unknown host
</code></pre>

<p>It seems that those tools, that are more integrated within Mac OS X 10.4 (and up), are not using the "/etc/resolv.conf" system anymore. Configuring them through scutil is no help, because it seems that if the wireless or the buildin ethernet interface is <strong>inactive</strong>, basic network functions don't seem to work.</p>

<p>In Linux (for example Ubuntu), it is possible to turn off the wireless adapter, without turning of the network capabilities. So in Linux it seems that I can work completely disconnected.</p>

<p>A solution could be using an ethernet loopback connector, but I would rather like a software solution, as both Windows and Linux don't have this problem.</p>

[{'answer_id': 66629, 'author': 'Mark Regensberg', 'author_id': 6735, 'author_profile': 'https://Stackoverflow.com/users/6735', 'pm_score': 0, 'selected': False, 'text': '<p>I run into this from time to time on different notebooks, and I have found the simplest is a low-tech, non software solution - create an ethernet loopback connecter. You can do it in 2 minutes with an old network cable, just cut the end off and join the send and receive pair just above the RJ45 connector. (obviously your interface needs a static IP)</p>\n\n<p>Old school, but completely software independent and good for working in a dev environment on long flights... :)</p>\n\n<p>there is a simple diagram <a href="http://www.juniper.net/techpubs/software/nog/nog-interfaces/html/fe-ge-loopback25.html" rel="nofollow noreferrer">here</a></p>\n'}, {'answer_id': 66756, 'author': 'Nicholas Riley', 'author_id': 6372, 'author_profile': 'https://Stackoverflow.com/users/6372', 'pm_score': 1, 'selected': False, 'text': '<p>On OS X starting in 10.4, <code>/etc/resolv.conf</code> is no longer the canonical location for DNS IP addresses.  Some Unix tools such as <code>dig</code> and <code>nslookup</code> will use it directly, but anything that uses Unix or Mac APIs to do DNS lookups will not.  Instead, configd maintains a database which provides many more options, like using different nameservers for different domains.  (A subset of this information is mirrored to <code>/etc/resolv.conf</code> for compatibility.)</p>\n\n<p>You can edit the nameserver info from code with <code>SCDynamicStore</code>, or use <code>scutil</code> interactively or from a script.  I posted some links to sample scripts for both methods <a href="http://njr.sabi.net/2005/11/07/alternate-openvpn-os-x-dns-updating-script/" rel="nofollow noreferrer">here</a>.  <a href="http://lists.apple.com/archives/Macnetworkprog/2005/Jun/msg00011.html" rel="nofollow noreferrer">This thread</a> from when I was trying to figure this stuff out may also be of some use.  </p>\n'}]
['https://Stackoverflow.com/questions/65925', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/9504/']