Kali Dns Problems
I have a problem. So, when I connect to any wi-fi station I can't use google or yandex. I solved that. The thing was in dns. I added google dns servers to 'resolv.conf' and it worked fine. However, after reconnection it does the same thing and I have to write manually or with script to set dns.
Is there any way to make this process automatically when the computer connects to the network? I tried to do it through the network/interfaces post-up and if-up.d . But it didn't help. The code is like that.
interfaces:
auto wlan0
iface wlan0 inet dhcp
post-up /etc/network/ssh_and_dns_start
ssh_and_dns_start:
#!/bin/sh
add_dns()
{
echo "nameserver 8.8.8.8
nameserver 8.8.4.4" >> /etc/resolv.conf
}
add_dns
exit 0
networking dns kali-linux
add a comment |
I have a problem. So, when I connect to any wi-fi station I can't use google or yandex. I solved that. The thing was in dns. I added google dns servers to 'resolv.conf' and it worked fine. However, after reconnection it does the same thing and I have to write manually or with script to set dns.
Is there any way to make this process automatically when the computer connects to the network? I tried to do it through the network/interfaces post-up and if-up.d . But it didn't help. The code is like that.
interfaces:
auto wlan0
iface wlan0 inet dhcp
post-up /etc/network/ssh_and_dns_start
ssh_and_dns_start:
#!/bin/sh
add_dns()
{
echo "nameserver 8.8.8.8
nameserver 8.8.4.4" >> /etc/resolv.conf
}
add_dns
exit 0
networking dns kali-linux
1
See askubuntu.com/questions/2321/…
– Panther
Dec 26 '15 at 14:08
@bodhi.zazen Thank you very much! But is there any chance to set default dns settings? Or should I add these dns to every network manually?
– Дима Долгополов
Dec 26 '15 at 16:00
What are you trying to do exactly ? In the link there are several options to set your dns server. And what do you mean by "dns to every network manually"?
– Panther
Dec 26 '15 at 18:33
@bodhi.zazen there is a method for setting dns for one network through Network Settings. But I want these setting for every network that I will connect in the future. Kinda default settings. That is my question.
– Дима Долгополов
Dec 27 '15 at 14:44
Those settings should work on all networks you connect to.
– Panther
Dec 28 '15 at 16:42
add a comment |
I have a problem. So, when I connect to any wi-fi station I can't use google or yandex. I solved that. The thing was in dns. I added google dns servers to 'resolv.conf' and it worked fine. However, after reconnection it does the same thing and I have to write manually or with script to set dns.
Is there any way to make this process automatically when the computer connects to the network? I tried to do it through the network/interfaces post-up and if-up.d . But it didn't help. The code is like that.
interfaces:
auto wlan0
iface wlan0 inet dhcp
post-up /etc/network/ssh_and_dns_start
ssh_and_dns_start:
#!/bin/sh
add_dns()
{
echo "nameserver 8.8.8.8
nameserver 8.8.4.4" >> /etc/resolv.conf
}
add_dns
exit 0
networking dns kali-linux
I have a problem. So, when I connect to any wi-fi station I can't use google or yandex. I solved that. The thing was in dns. I added google dns servers to 'resolv.conf' and it worked fine. However, after reconnection it does the same thing and I have to write manually or with script to set dns.
Is there any way to make this process automatically when the computer connects to the network? I tried to do it through the network/interfaces post-up and if-up.d . But it didn't help. The code is like that.
interfaces:
auto wlan0
iface wlan0 inet dhcp
post-up /etc/network/ssh_and_dns_start
ssh_and_dns_start:
#!/bin/sh
add_dns()
{
echo "nameserver 8.8.8.8
nameserver 8.8.4.4" >> /etc/resolv.conf
}
add_dns
exit 0
networking dns kali-linux
networking dns kali-linux
asked Dec 26 '15 at 12:03
Дима ДолгополовДима Долгополов
5927
5927
1
See askubuntu.com/questions/2321/…
– Panther
Dec 26 '15 at 14:08
@bodhi.zazen Thank you very much! But is there any chance to set default dns settings? Or should I add these dns to every network manually?
– Дима Долгополов
Dec 26 '15 at 16:00
What are you trying to do exactly ? In the link there are several options to set your dns server. And what do you mean by "dns to every network manually"?
– Panther
Dec 26 '15 at 18:33
@bodhi.zazen there is a method for setting dns for one network through Network Settings. But I want these setting for every network that I will connect in the future. Kinda default settings. That is my question.
– Дима Долгополов
Dec 27 '15 at 14:44
Those settings should work on all networks you connect to.
– Panther
Dec 28 '15 at 16:42
add a comment |
1
See askubuntu.com/questions/2321/…
– Panther
Dec 26 '15 at 14:08
@bodhi.zazen Thank you very much! But is there any chance to set default dns settings? Or should I add these dns to every network manually?
– Дима Долгополов
Dec 26 '15 at 16:00
What are you trying to do exactly ? In the link there are several options to set your dns server. And what do you mean by "dns to every network manually"?
– Panther
Dec 26 '15 at 18:33
@bodhi.zazen there is a method for setting dns for one network through Network Settings. But I want these setting for every network that I will connect in the future. Kinda default settings. That is my question.
– Дима Долгополов
Dec 27 '15 at 14:44
Those settings should work on all networks you connect to.
– Panther
Dec 28 '15 at 16:42
1
1
See askubuntu.com/questions/2321/…
– Panther
Dec 26 '15 at 14:08
See askubuntu.com/questions/2321/…
– Panther
Dec 26 '15 at 14:08
@bodhi.zazen Thank you very much! But is there any chance to set default dns settings? Or should I add these dns to every network manually?
– Дима Долгополов
Dec 26 '15 at 16:00
@bodhi.zazen Thank you very much! But is there any chance to set default dns settings? Or should I add these dns to every network manually?
– Дима Долгополов
Dec 26 '15 at 16:00
What are you trying to do exactly ? In the link there are several options to set your dns server. And what do you mean by "dns to every network manually"?
– Panther
Dec 26 '15 at 18:33
What are you trying to do exactly ? In the link there are several options to set your dns server. And what do you mean by "dns to every network manually"?
– Panther
Dec 26 '15 at 18:33
@bodhi.zazen there is a method for setting dns for one network through Network Settings. But I want these setting for every network that I will connect in the future. Kinda default settings. That is my question.
– Дима Долгополов
Dec 27 '15 at 14:44
@bodhi.zazen there is a method for setting dns for one network through Network Settings. But I want these setting for every network that I will connect in the future. Kinda default settings. That is my question.
– Дима Долгополов
Dec 27 '15 at 14:44
Those settings should work on all networks you connect to.
– Panther
Dec 28 '15 at 16:42
Those settings should work on all networks you connect to.
– Panther
Dec 28 '15 at 16:42
add a comment |
2 Answers
2
active
oldest
votes
Try adding this to /etc/dhcp/dhclient.conf
interface "wlan0"{
supersede domain-name-servers 8.8.8.8, 8.8.4.4;
}
add a comment |
The way I did it was hackish and probably not the way you would want to do it, but if you just need the bleeping thing working...
So I had set up Kali connected to ethernet and when I went to add a wifi connection, no DNS. /etc/resolv.conf pointed to something like /run/resolvconf/... which pointed to yet another thing.
There's not the option to sudo
yourself and vim /etc/resolv.conf
- for a few reasons. So logout, login as root, delete the symlink /etc/resolvconf/... points to, then vim /etc/resolv.conf
and add the nameservers you want, e.g.
nameserver your.gateway.ip
or
nameserver 8.8.8.8
nameserver 8.8.4.4
Before this, you can try
root@kali# dhclient wlan0
to get some information. I didn't find it very helpful. Editing the wireless connection settings with the GUI didn't work for me, even though it picked up on the nameservers. I just went ahead and deleted the symlink for /etc/resolv.conf and created /etc/resolv.conf, and all was fine.
add a comment |
Your Answer
StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "106"
};
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: false,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: null,
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%2funix.stackexchange.com%2fquestions%2f251620%2fkali-dns-problems%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
2 Answers
2
active
oldest
votes
2 Answers
2
active
oldest
votes
active
oldest
votes
active
oldest
votes
Try adding this to /etc/dhcp/dhclient.conf
interface "wlan0"{
supersede domain-name-servers 8.8.8.8, 8.8.4.4;
}
add a comment |
Try adding this to /etc/dhcp/dhclient.conf
interface "wlan0"{
supersede domain-name-servers 8.8.8.8, 8.8.4.4;
}
add a comment |
Try adding this to /etc/dhcp/dhclient.conf
interface "wlan0"{
supersede domain-name-servers 8.8.8.8, 8.8.4.4;
}
Try adding this to /etc/dhcp/dhclient.conf
interface "wlan0"{
supersede domain-name-servers 8.8.8.8, 8.8.4.4;
}
answered Feb 13 '16 at 19:04
ncomputersncomputers
8931519
8931519
add a comment |
add a comment |
The way I did it was hackish and probably not the way you would want to do it, but if you just need the bleeping thing working...
So I had set up Kali connected to ethernet and when I went to add a wifi connection, no DNS. /etc/resolv.conf pointed to something like /run/resolvconf/... which pointed to yet another thing.
There's not the option to sudo
yourself and vim /etc/resolv.conf
- for a few reasons. So logout, login as root, delete the symlink /etc/resolvconf/... points to, then vim /etc/resolv.conf
and add the nameservers you want, e.g.
nameserver your.gateway.ip
or
nameserver 8.8.8.8
nameserver 8.8.4.4
Before this, you can try
root@kali# dhclient wlan0
to get some information. I didn't find it very helpful. Editing the wireless connection settings with the GUI didn't work for me, even though it picked up on the nameservers. I just went ahead and deleted the symlink for /etc/resolv.conf and created /etc/resolv.conf, and all was fine.
add a comment |
The way I did it was hackish and probably not the way you would want to do it, but if you just need the bleeping thing working...
So I had set up Kali connected to ethernet and when I went to add a wifi connection, no DNS. /etc/resolv.conf pointed to something like /run/resolvconf/... which pointed to yet another thing.
There's not the option to sudo
yourself and vim /etc/resolv.conf
- for a few reasons. So logout, login as root, delete the symlink /etc/resolvconf/... points to, then vim /etc/resolv.conf
and add the nameservers you want, e.g.
nameserver your.gateway.ip
or
nameserver 8.8.8.8
nameserver 8.8.4.4
Before this, you can try
root@kali# dhclient wlan0
to get some information. I didn't find it very helpful. Editing the wireless connection settings with the GUI didn't work for me, even though it picked up on the nameservers. I just went ahead and deleted the symlink for /etc/resolv.conf and created /etc/resolv.conf, and all was fine.
add a comment |
The way I did it was hackish and probably not the way you would want to do it, but if you just need the bleeping thing working...
So I had set up Kali connected to ethernet and when I went to add a wifi connection, no DNS. /etc/resolv.conf pointed to something like /run/resolvconf/... which pointed to yet another thing.
There's not the option to sudo
yourself and vim /etc/resolv.conf
- for a few reasons. So logout, login as root, delete the symlink /etc/resolvconf/... points to, then vim /etc/resolv.conf
and add the nameservers you want, e.g.
nameserver your.gateway.ip
or
nameserver 8.8.8.8
nameserver 8.8.4.4
Before this, you can try
root@kali# dhclient wlan0
to get some information. I didn't find it very helpful. Editing the wireless connection settings with the GUI didn't work for me, even though it picked up on the nameservers. I just went ahead and deleted the symlink for /etc/resolv.conf and created /etc/resolv.conf, and all was fine.
The way I did it was hackish and probably not the way you would want to do it, but if you just need the bleeping thing working...
So I had set up Kali connected to ethernet and when I went to add a wifi connection, no DNS. /etc/resolv.conf pointed to something like /run/resolvconf/... which pointed to yet another thing.
There's not the option to sudo
yourself and vim /etc/resolv.conf
- for a few reasons. So logout, login as root, delete the symlink /etc/resolvconf/... points to, then vim /etc/resolv.conf
and add the nameservers you want, e.g.
nameserver your.gateway.ip
or
nameserver 8.8.8.8
nameserver 8.8.4.4
Before this, you can try
root@kali# dhclient wlan0
to get some information. I didn't find it very helpful. Editing the wireless connection settings with the GUI didn't work for me, even though it picked up on the nameservers. I just went ahead and deleted the symlink for /etc/resolv.conf and created /etc/resolv.conf, and all was fine.
edited Mar 10 '17 at 10:42
Thomas
3,93961327
3,93961327
answered Mar 10 '17 at 10:22
James YoungJames Young
1
1
add a comment |
add a comment |
Thanks for contributing an answer to Unix & Linux Stack Exchange!
- 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%2funix.stackexchange.com%2fquestions%2f251620%2fkali-dns-problems%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
1
See askubuntu.com/questions/2321/…
– Panther
Dec 26 '15 at 14:08
@bodhi.zazen Thank you very much! But is there any chance to set default dns settings? Or should I add these dns to every network manually?
– Дима Долгополов
Dec 26 '15 at 16:00
What are you trying to do exactly ? In the link there are several options to set your dns server. And what do you mean by "dns to every network manually"?
– Panther
Dec 26 '15 at 18:33
@bodhi.zazen there is a method for setting dns for one network through Network Settings. But I want these setting for every network that I will connect in the future. Kinda default settings. That is my question.
– Дима Долгополов
Dec 27 '15 at 14:44
Those settings should work on all networks you connect to.
– Panther
Dec 28 '15 at 16:42