netplan command to re-arrange nameserver ips in resolv.conf
I have 2 network interfaces on the Ubuntu 18.04.2 LTS
. Interface ens160
is public network, which take internet traffic and Interface ens192
is internal network. Each interface has it sets of DNS servers. When I run netplan apply
command I get internal network DNS Servers as top 2 name servers in the /etc/resolv.conf
file instead of public network's DNS servers This is causing slowness when talking to internet.
# cat /etc/resolv.conf
nameserver 10.120.0.10 <---internal network DNS Server
nameserver 10.120.0.20 <---internal network DNS Server
nameserver 190.90.7.20 <---public network DNS Server
# Too many DNS servers configured, the following entries may be ignored.
nameserver 190.90.7.50 <---public network DNS Server
search domain.com
#
18.04
add a comment |
I have 2 network interfaces on the Ubuntu 18.04.2 LTS
. Interface ens160
is public network, which take internet traffic and Interface ens192
is internal network. Each interface has it sets of DNS servers. When I run netplan apply
command I get internal network DNS Servers as top 2 name servers in the /etc/resolv.conf
file instead of public network's DNS servers This is causing slowness when talking to internet.
# cat /etc/resolv.conf
nameserver 10.120.0.10 <---internal network DNS Server
nameserver 10.120.0.20 <---internal network DNS Server
nameserver 190.90.7.20 <---public network DNS Server
# Too many DNS servers configured, the following entries may be ignored.
nameserver 190.90.7.50 <---public network DNS Server
search domain.com
#
18.04
Try separating your ethernet interfaces into two different .yaml files, and start their filenames with 01- and 02-, using the lowered numbered file with public DNS servers, and the higher numbered file with internal DNS servers. (reverse this if they are still in the wrong order in /etc/resolv.conf).
– heynnema
3 hours ago
It didn't work. I created two separate files for each interface under/etc/netplan
directory.
– bobby
2 hours ago
When using two files, edit your question with the output ofresolvectl
. I'm curious where it places the DNS servers in relation to the interfaces.
– heynnema
9 mins ago
add a comment |
I have 2 network interfaces on the Ubuntu 18.04.2 LTS
. Interface ens160
is public network, which take internet traffic and Interface ens192
is internal network. Each interface has it sets of DNS servers. When I run netplan apply
command I get internal network DNS Servers as top 2 name servers in the /etc/resolv.conf
file instead of public network's DNS servers This is causing slowness when talking to internet.
# cat /etc/resolv.conf
nameserver 10.120.0.10 <---internal network DNS Server
nameserver 10.120.0.20 <---internal network DNS Server
nameserver 190.90.7.20 <---public network DNS Server
# Too many DNS servers configured, the following entries may be ignored.
nameserver 190.90.7.50 <---public network DNS Server
search domain.com
#
18.04
I have 2 network interfaces on the Ubuntu 18.04.2 LTS
. Interface ens160
is public network, which take internet traffic and Interface ens192
is internal network. Each interface has it sets of DNS servers. When I run netplan apply
command I get internal network DNS Servers as top 2 name servers in the /etc/resolv.conf
file instead of public network's DNS servers This is causing slowness when talking to internet.
# cat /etc/resolv.conf
nameserver 10.120.0.10 <---internal network DNS Server
nameserver 10.120.0.20 <---internal network DNS Server
nameserver 190.90.7.20 <---public network DNS Server
# Too many DNS servers configured, the following entries may be ignored.
nameserver 190.90.7.50 <---public network DNS Server
search domain.com
#
18.04
18.04
asked 4 hours ago
bobbybobby
11
11
Try separating your ethernet interfaces into two different .yaml files, and start their filenames with 01- and 02-, using the lowered numbered file with public DNS servers, and the higher numbered file with internal DNS servers. (reverse this if they are still in the wrong order in /etc/resolv.conf).
– heynnema
3 hours ago
It didn't work. I created two separate files for each interface under/etc/netplan
directory.
– bobby
2 hours ago
When using two files, edit your question with the output ofresolvectl
. I'm curious where it places the DNS servers in relation to the interfaces.
– heynnema
9 mins ago
add a comment |
Try separating your ethernet interfaces into two different .yaml files, and start their filenames with 01- and 02-, using the lowered numbered file with public DNS servers, and the higher numbered file with internal DNS servers. (reverse this if they are still in the wrong order in /etc/resolv.conf).
– heynnema
3 hours ago
It didn't work. I created two separate files for each interface under/etc/netplan
directory.
– bobby
2 hours ago
When using two files, edit your question with the output ofresolvectl
. I'm curious where it places the DNS servers in relation to the interfaces.
– heynnema
9 mins ago
Try separating your ethernet interfaces into two different .yaml files, and start their filenames with 01- and 02-, using the lowered numbered file with public DNS servers, and the higher numbered file with internal DNS servers. (reverse this if they are still in the wrong order in /etc/resolv.conf).
– heynnema
3 hours ago
Try separating your ethernet interfaces into two different .yaml files, and start their filenames with 01- and 02-, using the lowered numbered file with public DNS servers, and the higher numbered file with internal DNS servers. (reverse this if they are still in the wrong order in /etc/resolv.conf).
– heynnema
3 hours ago
It didn't work. I created two separate files for each interface under
/etc/netplan
directory.– bobby
2 hours ago
It didn't work. I created two separate files for each interface under
/etc/netplan
directory.– bobby
2 hours ago
When using two files, edit your question with the output of
resolvectl
. I'm curious where it places the DNS servers in relation to the interfaces.– heynnema
9 mins ago
When using two files, edit your question with the output of
resolvectl
. I'm curious where it places the DNS servers in relation to the interfaces.– heynnema
9 mins ago
add a comment |
0
active
oldest
votes
Your Answer
StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "89"
};
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%2faskubuntu.com%2fquestions%2f1124871%2fnetplan-command-to-re-arrange-nameserver-ips-in-resolv-conf%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
0
active
oldest
votes
0
active
oldest
votes
active
oldest
votes
active
oldest
votes
Thanks for contributing an answer to Ask Ubuntu!
- 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%2faskubuntu.com%2fquestions%2f1124871%2fnetplan-command-to-re-arrange-nameserver-ips-in-resolv-conf%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
Try separating your ethernet interfaces into two different .yaml files, and start their filenames with 01- and 02-, using the lowered numbered file with public DNS servers, and the higher numbered file with internal DNS servers. (reverse this if they are still in the wrong order in /etc/resolv.conf).
– heynnema
3 hours ago
It didn't work. I created two separate files for each interface under
/etc/netplan
directory.– bobby
2 hours ago
When using two files, edit your question with the output of
resolvectl
. I'm curious where it places the DNS servers in relation to the interfaces.– heynnema
9 mins ago