Where can I force a specific DNS server to be used on OS X? Announcing the arrival of Valued...
What is a Meta algorithm?
Disable hyphenation for an entire paragraph
The logistics of corpse disposal
What's the difference between `auto x = vector<int>()` and `vector<int> x`?
Is there a concise way to say "all of the X, one of each"?
How do I mention the quality of my school without bragging
What are the motives behind Cersei's orders given to Bronn?
List *all* the tuples!
When is phishing education going too far?
How to deal with a team lead who never gives me credit?
Why is there no army of Iron-Mans in the MCU?
If Jon Snow became King of the Seven Kingdoms what would his regnal number be?
Why was the term "discrete" used in discrete logarithm?
How to bypass password on Windows XP account?
Should I call the interviewer directly, if HR aren't responding?
Why is "Captain Marvel" translated as male in Portugal?
Is there any avatar supposed to be born between the death of Krishna and the birth of Kalki?
How do I keep my slimes from escaping their pens?
How to find all the available tools in macOS terminal?
How discoverable are IPv6 addresses and AAAA names by potential attackers?
iPhone Wallpaper?
How do I stop a creek from eroding my steep embankment?
Storing hydrofluoric acid before the invention of plastics
Withdrew £2800, but only £2000 shows as withdrawn on online banking; what are my obligations?
Where can I force a specific DNS server to be used on OS X?
Announcing the arrival of Valued Associate #679: Cesar Manara
Planned maintenance scheduled April 17/18, 2019 at 00:00UTC (8:00pm US/Eastern)Change DNS Server From Terminal (or script) on Mac OS XVPN messes up DNS resolutionSetup DNS server on a Leopard machine?where to find used dns settingsHow can I set up a 'local' domain so that everyone on my local network can view a locally hosted site?Where can I learn about DNS settingsBrowsing specific website with specific DNS serverHow to force DNS for specific clients?Dns server for specific domainObtain Specific Preferred DNS ServerUsing specific dns server for specific domainsForce DNS Server on network
.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty{ height:90px;width:728px;box-sizing:border-box;
}
On OS X Leopard, scutil
gives me
$ scutil --dns
DNS configuration
resolver #1
nameserver[0] : 192.168.1.1
nameserver[1] : 192.168.2.1
order : 200000
resolver #2
domain : local
options : mdns
timeout : 2
order : 300000
...
Now, how do I remove the first "resolver #1" and replace with a DNS server of my choosing?
Context: A VPN client sets this bogus DNS entry on connection, replacing my working DNS settings. I haven't been able to figure out how to stop it from doing so (see here), so now I'm trying to remove this unwanted effect ex-post, after I connect. A command line script to do this would be perfect.
I tried sudo scutil
as per instructions here, but no love -- scutil --dns
still reports the settings unchanged, and DNS resolution still doesn't work. Modifying /etc/resolv.conf
has no effect on OS X.
macos dns osx-leopard
add a comment |
On OS X Leopard, scutil
gives me
$ scutil --dns
DNS configuration
resolver #1
nameserver[0] : 192.168.1.1
nameserver[1] : 192.168.2.1
order : 200000
resolver #2
domain : local
options : mdns
timeout : 2
order : 300000
...
Now, how do I remove the first "resolver #1" and replace with a DNS server of my choosing?
Context: A VPN client sets this bogus DNS entry on connection, replacing my working DNS settings. I haven't been able to figure out how to stop it from doing so (see here), so now I'm trying to remove this unwanted effect ex-post, after I connect. A command line script to do this would be perfect.
I tried sudo scutil
as per instructions here, but no love -- scutil --dns
still reports the settings unchanged, and DNS resolution still doesn't work. Modifying /etc/resolv.conf
has no effect on OS X.
macos dns osx-leopard
Did you try that? Mac OS X Lion, /etc/hosts Bugs, and DNS Resolution
– user149200
Jul 30 '12 at 17:58
add a comment |
On OS X Leopard, scutil
gives me
$ scutil --dns
DNS configuration
resolver #1
nameserver[0] : 192.168.1.1
nameserver[1] : 192.168.2.1
order : 200000
resolver #2
domain : local
options : mdns
timeout : 2
order : 300000
...
Now, how do I remove the first "resolver #1" and replace with a DNS server of my choosing?
Context: A VPN client sets this bogus DNS entry on connection, replacing my working DNS settings. I haven't been able to figure out how to stop it from doing so (see here), so now I'm trying to remove this unwanted effect ex-post, after I connect. A command line script to do this would be perfect.
I tried sudo scutil
as per instructions here, but no love -- scutil --dns
still reports the settings unchanged, and DNS resolution still doesn't work. Modifying /etc/resolv.conf
has no effect on OS X.
macos dns osx-leopard
On OS X Leopard, scutil
gives me
$ scutil --dns
DNS configuration
resolver #1
nameserver[0] : 192.168.1.1
nameserver[1] : 192.168.2.1
order : 200000
resolver #2
domain : local
options : mdns
timeout : 2
order : 300000
...
Now, how do I remove the first "resolver #1" and replace with a DNS server of my choosing?
Context: A VPN client sets this bogus DNS entry on connection, replacing my working DNS settings. I haven't been able to figure out how to stop it from doing so (see here), so now I'm trying to remove this unwanted effect ex-post, after I connect. A command line script to do this would be perfect.
I tried sudo scutil
as per instructions here, but no love -- scutil --dns
still reports the settings unchanged, and DNS resolution still doesn't work. Modifying /etc/resolv.conf
has no effect on OS X.
macos dns osx-leopard
macos dns osx-leopard
edited Mar 20 '17 at 10:17
Community♦
1
1
asked Mar 28 '12 at 19:14
user124114user124114
2651512
2651512
Did you try that? Mac OS X Lion, /etc/hosts Bugs, and DNS Resolution
– user149200
Jul 30 '12 at 17:58
add a comment |
Did you try that? Mac OS X Lion, /etc/hosts Bugs, and DNS Resolution
– user149200
Jul 30 '12 at 17:58
Did you try that? Mac OS X Lion, /etc/hosts Bugs, and DNS Resolution
– user149200
Jul 30 '12 at 17:58
Did you try that? Mac OS X Lion, /etc/hosts Bugs, and DNS Resolution
– user149200
Jul 30 '12 at 17:58
add a comment |
4 Answers
4
active
oldest
votes
Well, most VPN connections I am aware of are able to push a DNS server to the VPN client. My suggestion would be to ask your VPN provider to not push the DNS server for your connection.
Please note that this might have some negative impact on your VPN session.
thank you, but unfortunately that's not possible. So the OS offers no way for me to use a DNS server of my choice on my computer?
– user124114
Mar 28 '12 at 20:06
Hm, OS X is still Unix. You could modifiy the /etc/resolf.conf (or the adequate counterpart of it in Unix) after you established the VPN connection. Another way might be to set an immutable bit on the file.
– Valentin
Mar 28 '12 at 20:34
Unfortunately, in OS X/etc/resolv.conf
is auto-generated and changing it has no effect.
– user124114
Mar 28 '12 at 20:43
add a comment |
In my experience if you specify a particular DNS server in Network preferences, even if you're using DHCP, Mac OS uses that server in preference to the one obtained through DHCP. So if you always want to use 192.168.1.1, put that in explicitly.
System Preferences -> Network -> Ethernet (left pane) should produce a window that has a "DNS Server:" text box you can fill in with the IP address of your desired DNS server. Click "Apply" to apply the change, and you're done; you shouldn't have to make this change again. (If your VPN connection is WiFi instead of Ethernet, then you should click on that instead of Ethernet above.)
Thanks, I tried this. But after connecting the VPN client, the bad DNS server is still set (overwriting the previous, working one), and I still don't know how to get rid of it :(
– user124114
Mar 31 '12 at 12:02
add a comment |
For temporary override on command line you can do:
sudo networksetup -setdnsservers Wi-Fi <dnsserver1ip> <dnsserver2ip>
and reset settings with:
sudo networksetup -setdnsservers Wi-Fi empty
If connected with some other interface than Wi-fi you can check valid names with:
sudo networksetup -listallnetworkservices
New contributor
add a comment |
You should have your vpn set up in your network. I have private internet access and have it manually installed in my network. My network shows Airport, Ethernet and Private Internet access.
To change my dns:
- click on your vpn network
- hit advanced and in options "send all traffic over VPN" should be checked
- click the DNS tab and add your dns in the box. If you don't put any dns servers it will push to your ethernet dns settings.
Now to check if you are running on your dns ccp this in terminal:
scutil --dns | grep nameserver[[0-9]*]
add a comment |
Your Answer
StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "3"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});
function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});
}
});
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fsuperuser.com%2fquestions%2f405892%2fwhere-can-i-force-a-specific-dns-server-to-be-used-on-os-x%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
4 Answers
4
active
oldest
votes
4 Answers
4
active
oldest
votes
active
oldest
votes
active
oldest
votes
Well, most VPN connections I am aware of are able to push a DNS server to the VPN client. My suggestion would be to ask your VPN provider to not push the DNS server for your connection.
Please note that this might have some negative impact on your VPN session.
thank you, but unfortunately that's not possible. So the OS offers no way for me to use a DNS server of my choice on my computer?
– user124114
Mar 28 '12 at 20:06
Hm, OS X is still Unix. You could modifiy the /etc/resolf.conf (or the adequate counterpart of it in Unix) after you established the VPN connection. Another way might be to set an immutable bit on the file.
– Valentin
Mar 28 '12 at 20:34
Unfortunately, in OS X/etc/resolv.conf
is auto-generated and changing it has no effect.
– user124114
Mar 28 '12 at 20:43
add a comment |
Well, most VPN connections I am aware of are able to push a DNS server to the VPN client. My suggestion would be to ask your VPN provider to not push the DNS server for your connection.
Please note that this might have some negative impact on your VPN session.
thank you, but unfortunately that's not possible. So the OS offers no way for me to use a DNS server of my choice on my computer?
– user124114
Mar 28 '12 at 20:06
Hm, OS X is still Unix. You could modifiy the /etc/resolf.conf (or the adequate counterpart of it in Unix) after you established the VPN connection. Another way might be to set an immutable bit on the file.
– Valentin
Mar 28 '12 at 20:34
Unfortunately, in OS X/etc/resolv.conf
is auto-generated and changing it has no effect.
– user124114
Mar 28 '12 at 20:43
add a comment |
Well, most VPN connections I am aware of are able to push a DNS server to the VPN client. My suggestion would be to ask your VPN provider to not push the DNS server for your connection.
Please note that this might have some negative impact on your VPN session.
Well, most VPN connections I am aware of are able to push a DNS server to the VPN client. My suggestion would be to ask your VPN provider to not push the DNS server for your connection.
Please note that this might have some negative impact on your VPN session.
answered Mar 28 '12 at 19:51
ValentinValentin
801614
801614
thank you, but unfortunately that's not possible. So the OS offers no way for me to use a DNS server of my choice on my computer?
– user124114
Mar 28 '12 at 20:06
Hm, OS X is still Unix. You could modifiy the /etc/resolf.conf (or the adequate counterpart of it in Unix) after you established the VPN connection. Another way might be to set an immutable bit on the file.
– Valentin
Mar 28 '12 at 20:34
Unfortunately, in OS X/etc/resolv.conf
is auto-generated and changing it has no effect.
– user124114
Mar 28 '12 at 20:43
add a comment |
thank you, but unfortunately that's not possible. So the OS offers no way for me to use a DNS server of my choice on my computer?
– user124114
Mar 28 '12 at 20:06
Hm, OS X is still Unix. You could modifiy the /etc/resolf.conf (or the adequate counterpart of it in Unix) after you established the VPN connection. Another way might be to set an immutable bit on the file.
– Valentin
Mar 28 '12 at 20:34
Unfortunately, in OS X/etc/resolv.conf
is auto-generated and changing it has no effect.
– user124114
Mar 28 '12 at 20:43
thank you, but unfortunately that's not possible. So the OS offers no way for me to use a DNS server of my choice on my computer?
– user124114
Mar 28 '12 at 20:06
thank you, but unfortunately that's not possible. So the OS offers no way for me to use a DNS server of my choice on my computer?
– user124114
Mar 28 '12 at 20:06
Hm, OS X is still Unix. You could modifiy the /etc/resolf.conf (or the adequate counterpart of it in Unix) after you established the VPN connection. Another way might be to set an immutable bit on the file.
– Valentin
Mar 28 '12 at 20:34
Hm, OS X is still Unix. You could modifiy the /etc/resolf.conf (or the adequate counterpart of it in Unix) after you established the VPN connection. Another way might be to set an immutable bit on the file.
– Valentin
Mar 28 '12 at 20:34
Unfortunately, in OS X
/etc/resolv.conf
is auto-generated and changing it has no effect.– user124114
Mar 28 '12 at 20:43
Unfortunately, in OS X
/etc/resolv.conf
is auto-generated and changing it has no effect.– user124114
Mar 28 '12 at 20:43
add a comment |
In my experience if you specify a particular DNS server in Network preferences, even if you're using DHCP, Mac OS uses that server in preference to the one obtained through DHCP. So if you always want to use 192.168.1.1, put that in explicitly.
System Preferences -> Network -> Ethernet (left pane) should produce a window that has a "DNS Server:" text box you can fill in with the IP address of your desired DNS server. Click "Apply" to apply the change, and you're done; you shouldn't have to make this change again. (If your VPN connection is WiFi instead of Ethernet, then you should click on that instead of Ethernet above.)
Thanks, I tried this. But after connecting the VPN client, the bad DNS server is still set (overwriting the previous, working one), and I still don't know how to get rid of it :(
– user124114
Mar 31 '12 at 12:02
add a comment |
In my experience if you specify a particular DNS server in Network preferences, even if you're using DHCP, Mac OS uses that server in preference to the one obtained through DHCP. So if you always want to use 192.168.1.1, put that in explicitly.
System Preferences -> Network -> Ethernet (left pane) should produce a window that has a "DNS Server:" text box you can fill in with the IP address of your desired DNS server. Click "Apply" to apply the change, and you're done; you shouldn't have to make this change again. (If your VPN connection is WiFi instead of Ethernet, then you should click on that instead of Ethernet above.)
Thanks, I tried this. But after connecting the VPN client, the bad DNS server is still set (overwriting the previous, working one), and I still don't know how to get rid of it :(
– user124114
Mar 31 '12 at 12:02
add a comment |
In my experience if you specify a particular DNS server in Network preferences, even if you're using DHCP, Mac OS uses that server in preference to the one obtained through DHCP. So if you always want to use 192.168.1.1, put that in explicitly.
System Preferences -> Network -> Ethernet (left pane) should produce a window that has a "DNS Server:" text box you can fill in with the IP address of your desired DNS server. Click "Apply" to apply the change, and you're done; you shouldn't have to make this change again. (If your VPN connection is WiFi instead of Ethernet, then you should click on that instead of Ethernet above.)
In my experience if you specify a particular DNS server in Network preferences, even if you're using DHCP, Mac OS uses that server in preference to the one obtained through DHCP. So if you always want to use 192.168.1.1, put that in explicitly.
System Preferences -> Network -> Ethernet (left pane) should produce a window that has a "DNS Server:" text box you can fill in with the IP address of your desired DNS server. Click "Apply" to apply the change, and you're done; you shouldn't have to make this change again. (If your VPN connection is WiFi instead of Ethernet, then you should click on that instead of Ethernet above.)
answered Mar 28 '12 at 21:16
Kyle JonesKyle Jones
5,59621729
5,59621729
Thanks, I tried this. But after connecting the VPN client, the bad DNS server is still set (overwriting the previous, working one), and I still don't know how to get rid of it :(
– user124114
Mar 31 '12 at 12:02
add a comment |
Thanks, I tried this. But after connecting the VPN client, the bad DNS server is still set (overwriting the previous, working one), and I still don't know how to get rid of it :(
– user124114
Mar 31 '12 at 12:02
Thanks, I tried this. But after connecting the VPN client, the bad DNS server is still set (overwriting the previous, working one), and I still don't know how to get rid of it :(
– user124114
Mar 31 '12 at 12:02
Thanks, I tried this. But after connecting the VPN client, the bad DNS server is still set (overwriting the previous, working one), and I still don't know how to get rid of it :(
– user124114
Mar 31 '12 at 12:02
add a comment |
For temporary override on command line you can do:
sudo networksetup -setdnsservers Wi-Fi <dnsserver1ip> <dnsserver2ip>
and reset settings with:
sudo networksetup -setdnsservers Wi-Fi empty
If connected with some other interface than Wi-fi you can check valid names with:
sudo networksetup -listallnetworkservices
New contributor
add a comment |
For temporary override on command line you can do:
sudo networksetup -setdnsservers Wi-Fi <dnsserver1ip> <dnsserver2ip>
and reset settings with:
sudo networksetup -setdnsservers Wi-Fi empty
If connected with some other interface than Wi-fi you can check valid names with:
sudo networksetup -listallnetworkservices
New contributor
add a comment |
For temporary override on command line you can do:
sudo networksetup -setdnsservers Wi-Fi <dnsserver1ip> <dnsserver2ip>
and reset settings with:
sudo networksetup -setdnsservers Wi-Fi empty
If connected with some other interface than Wi-fi you can check valid names with:
sudo networksetup -listallnetworkservices
New contributor
For temporary override on command line you can do:
sudo networksetup -setdnsservers Wi-Fi <dnsserver1ip> <dnsserver2ip>
and reset settings with:
sudo networksetup -setdnsservers Wi-Fi empty
If connected with some other interface than Wi-fi you can check valid names with:
sudo networksetup -listallnetworkservices
New contributor
New contributor
answered yesterday
Mikael LepistöMikael Lepistö
1011
1011
New contributor
New contributor
add a comment |
add a comment |
You should have your vpn set up in your network. I have private internet access and have it manually installed in my network. My network shows Airport, Ethernet and Private Internet access.
To change my dns:
- click on your vpn network
- hit advanced and in options "send all traffic over VPN" should be checked
- click the DNS tab and add your dns in the box. If you don't put any dns servers it will push to your ethernet dns settings.
Now to check if you are running on your dns ccp this in terminal:
scutil --dns | grep nameserver[[0-9]*]
add a comment |
You should have your vpn set up in your network. I have private internet access and have it manually installed in my network. My network shows Airport, Ethernet and Private Internet access.
To change my dns:
- click on your vpn network
- hit advanced and in options "send all traffic over VPN" should be checked
- click the DNS tab and add your dns in the box. If you don't put any dns servers it will push to your ethernet dns settings.
Now to check if you are running on your dns ccp this in terminal:
scutil --dns | grep nameserver[[0-9]*]
add a comment |
You should have your vpn set up in your network. I have private internet access and have it manually installed in my network. My network shows Airport, Ethernet and Private Internet access.
To change my dns:
- click on your vpn network
- hit advanced and in options "send all traffic over VPN" should be checked
- click the DNS tab and add your dns in the box. If you don't put any dns servers it will push to your ethernet dns settings.
Now to check if you are running on your dns ccp this in terminal:
scutil --dns | grep nameserver[[0-9]*]
You should have your vpn set up in your network. I have private internet access and have it manually installed in my network. My network shows Airport, Ethernet and Private Internet access.
To change my dns:
- click on your vpn network
- hit advanced and in options "send all traffic over VPN" should be checked
- click the DNS tab and add your dns in the box. If you don't put any dns servers it will push to your ethernet dns settings.
Now to check if you are running on your dns ccp this in terminal:
scutil --dns | grep nameserver[[0-9]*]
edited Feb 19 '14 at 16:36
Andrea
1,43631316
1,43631316
answered Feb 19 '14 at 15:25
ralphralph
1
1
add a comment |
add a comment |
Thanks for contributing an answer to Super User!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fsuperuser.com%2fquestions%2f405892%2fwhere-can-i-force-a-specific-dns-server-to-be-used-on-os-x%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Did you try that? Mac OS X Lion, /etc/hosts Bugs, and DNS Resolution
– user149200
Jul 30 '12 at 17:58