File /etc/resolv.conf deleted on every reboot, why or what?
up vote
5
down vote
favorite
I am having an issue where DHCP (I though as I read in other similar topics) is clearing the I am not sure about how to deal with this since the post I have found (1, 2 and some others) are for Debian based distros or other but not Fedora./etc/resolv.conf
file on each boot.
This is the output of ifcfg-enp0s31f6
so for sure is DHCP:
cat /etc/sysconfig/network-scripts/ifcfg-enp0s31f6
HWADDR=C8:5B:76:1A:8E:55
TYPE=Ethernet
DEFROUTE=yes
IPV4_FAILURE_FATAL=no
IPV6INIT=no
IPV6_AUTOCONF=no
IPV6_DEFROUTE=no
IPV6_FAILURE_FATAL=no
IPV6_ADDR_GEN_MODE=stable-privacy
NAME=enp0s31f6
UUID=0af812a3-ac8e-32a0-887d-10884872d6c7
ONBOOT=yes
IPV6_PEERDNS=no
IPV6_PEERROUTES=no
BOOTPROTO=dhcp
PEERDNS=yes
PEERROUTES=yes
In the other side I don't know if Network Manager is doing something else around this.
Update: Content of NetworkManager.conf (I have removed the comments since are useless)
$ cat /etc/NetworkManager/NetworkManager.conf
[main]
#plugins=ifcfg-rh,ibft
dns=none
[logging]
#domains=ALL
Can I get some help with this? It's annonying be setting up the file once and once on every reboot.
UPDATE 2
After a month I'm still having the same issue where file gets deleted by "something".
Here is the steps I did follow in order to make a fresh test:
- Reboot the PC
After PC gets restarted open a terminal and try to
ping
Google servers of course without success:
$ ping google.com
ping: google.com: Name or service not known
Check the network configuration were all seems to be fine:
$ cat /etc/sysconfig/network-scripts/ifcfg-enp0s31f6
NAME=enp0s31f6
ONBOOT=yes
HWADDR=C8:5B:76:1A:8E:55
MACADDR=C8:5B:76:1A:8E:55
UUID=0af812a3-ac8e-32a0-887d-10884872d6c7
BOOTPROTO=static
PEERDNS=no
DNS1=8.8.8.8
DNS2=8.8.4.4
DNS3=192.168.1.10
NM_CONTROLLED=yes
IPADDR=192.168.1.66
NETMASK=255.255.255.0
BROADCAST=192.168.1.255
GATEWAY=192.168.1.1
TYPE=Ethernet
DEFROUTE=yes
IPV4_FAILURE_FATAL=no
IPV6INIT=no
Restart the
network
service:
$ sudo service network restart
[sudo] password for <current_user>:
Restarting network (via systemctl): [ OK ]
Try to
ping
Google servers again, with no success:
$ ping google.com
ping: google.com: Name or service not known
Check for file
/etc/resolv.conf
:
$ cat /etc/resolv.conf
cat: /etc/resolv.conf: No such file or directory
File doesn't exists anymore - and this is the problem something is deleting it on every reboot
Create the file and add the content of DNS:
$ sudo nano /etc/resolv.conf
Ping Google servers this time with success:
$ ping google.com
PING google.com (216.58.192.110) 56(84) bytes of data.
64 bytes from mia07s35-in-f110.1e100.net (216.58.192.110): icmp_seq=1 ttl=57 time=3.87 ms
Any ideas in what could be happening here?
networking fedora networkmanager dhcp resolv.conf
|
show 2 more comments
up vote
5
down vote
favorite
I am having an issue where DHCP (I though as I read in other similar topics) is clearing the I am not sure about how to deal with this since the post I have found (1, 2 and some others) are for Debian based distros or other but not Fedora./etc/resolv.conf
file on each boot.
This is the output of ifcfg-enp0s31f6
so for sure is DHCP:
cat /etc/sysconfig/network-scripts/ifcfg-enp0s31f6
HWADDR=C8:5B:76:1A:8E:55
TYPE=Ethernet
DEFROUTE=yes
IPV4_FAILURE_FATAL=no
IPV6INIT=no
IPV6_AUTOCONF=no
IPV6_DEFROUTE=no
IPV6_FAILURE_FATAL=no
IPV6_ADDR_GEN_MODE=stable-privacy
NAME=enp0s31f6
UUID=0af812a3-ac8e-32a0-887d-10884872d6c7
ONBOOT=yes
IPV6_PEERDNS=no
IPV6_PEERROUTES=no
BOOTPROTO=dhcp
PEERDNS=yes
PEERROUTES=yes
In the other side I don't know if Network Manager is doing something else around this.
Update: Content of NetworkManager.conf (I have removed the comments since are useless)
$ cat /etc/NetworkManager/NetworkManager.conf
[main]
#plugins=ifcfg-rh,ibft
dns=none
[logging]
#domains=ALL
Can I get some help with this? It's annonying be setting up the file once and once on every reboot.
UPDATE 2
After a month I'm still having the same issue where file gets deleted by "something".
Here is the steps I did follow in order to make a fresh test:
- Reboot the PC
After PC gets restarted open a terminal and try to
ping
Google servers of course without success:
$ ping google.com
ping: google.com: Name or service not known
Check the network configuration were all seems to be fine:
$ cat /etc/sysconfig/network-scripts/ifcfg-enp0s31f6
NAME=enp0s31f6
ONBOOT=yes
HWADDR=C8:5B:76:1A:8E:55
MACADDR=C8:5B:76:1A:8E:55
UUID=0af812a3-ac8e-32a0-887d-10884872d6c7
BOOTPROTO=static
PEERDNS=no
DNS1=8.8.8.8
DNS2=8.8.4.4
DNS3=192.168.1.10
NM_CONTROLLED=yes
IPADDR=192.168.1.66
NETMASK=255.255.255.0
BROADCAST=192.168.1.255
GATEWAY=192.168.1.1
TYPE=Ethernet
DEFROUTE=yes
IPV4_FAILURE_FATAL=no
IPV6INIT=no
Restart the
network
service:
$ sudo service network restart
[sudo] password for <current_user>:
Restarting network (via systemctl): [ OK ]
Try to
ping
Google servers again, with no success:
$ ping google.com
ping: google.com: Name or service not known
Check for file
/etc/resolv.conf
:
$ cat /etc/resolv.conf
cat: /etc/resolv.conf: No such file or directory
File doesn't exists anymore - and this is the problem something is deleting it on every reboot
Create the file and add the content of DNS:
$ sudo nano /etc/resolv.conf
Ping Google servers this time with success:
$ ping google.com
PING google.com (216.58.192.110) 56(84) bytes of data.
64 bytes from mia07s35-in-f110.1e100.net (216.58.192.110): icmp_seq=1 ttl=57 time=3.87 ms
Any ideas in what could be happening here?
networking fedora networkmanager dhcp resolv.conf
3
mayPEERDNS=no
help you
– Ipor Sircer
Nov 15 '16 at 15:11
@IporSircer no, I have changed the value and restart the PC, same result, no DNS information. BTW do I need to restart the PC orservice network restart
would be enough?
– ReynierPM
Nov 15 '16 at 15:20
Trychattr +i /etc/resolv.conf
– GAD3R
Nov 16 '16 at 19:02
@GAD3R not working:chattr: Operation not supported while reading flags on /etc/resolv.conf
– ReynierPM
Nov 16 '16 at 19:37
Which Fedora version (and Spin/Edition) are you using?
– mattdm
Nov 24 '16 at 18:49
|
show 2 more comments
up vote
5
down vote
favorite
up vote
5
down vote
favorite
I am having an issue where DHCP (I though as I read in other similar topics) is clearing the I am not sure about how to deal with this since the post I have found (1, 2 and some others) are for Debian based distros or other but not Fedora./etc/resolv.conf
file on each boot.
This is the output of ifcfg-enp0s31f6
so for sure is DHCP:
cat /etc/sysconfig/network-scripts/ifcfg-enp0s31f6
HWADDR=C8:5B:76:1A:8E:55
TYPE=Ethernet
DEFROUTE=yes
IPV4_FAILURE_FATAL=no
IPV6INIT=no
IPV6_AUTOCONF=no
IPV6_DEFROUTE=no
IPV6_FAILURE_FATAL=no
IPV6_ADDR_GEN_MODE=stable-privacy
NAME=enp0s31f6
UUID=0af812a3-ac8e-32a0-887d-10884872d6c7
ONBOOT=yes
IPV6_PEERDNS=no
IPV6_PEERROUTES=no
BOOTPROTO=dhcp
PEERDNS=yes
PEERROUTES=yes
In the other side I don't know if Network Manager is doing something else around this.
Update: Content of NetworkManager.conf (I have removed the comments since are useless)
$ cat /etc/NetworkManager/NetworkManager.conf
[main]
#plugins=ifcfg-rh,ibft
dns=none
[logging]
#domains=ALL
Can I get some help with this? It's annonying be setting up the file once and once on every reboot.
UPDATE 2
After a month I'm still having the same issue where file gets deleted by "something".
Here is the steps I did follow in order to make a fresh test:
- Reboot the PC
After PC gets restarted open a terminal and try to
ping
Google servers of course without success:
$ ping google.com
ping: google.com: Name or service not known
Check the network configuration were all seems to be fine:
$ cat /etc/sysconfig/network-scripts/ifcfg-enp0s31f6
NAME=enp0s31f6
ONBOOT=yes
HWADDR=C8:5B:76:1A:8E:55
MACADDR=C8:5B:76:1A:8E:55
UUID=0af812a3-ac8e-32a0-887d-10884872d6c7
BOOTPROTO=static
PEERDNS=no
DNS1=8.8.8.8
DNS2=8.8.4.4
DNS3=192.168.1.10
NM_CONTROLLED=yes
IPADDR=192.168.1.66
NETMASK=255.255.255.0
BROADCAST=192.168.1.255
GATEWAY=192.168.1.1
TYPE=Ethernet
DEFROUTE=yes
IPV4_FAILURE_FATAL=no
IPV6INIT=no
Restart the
network
service:
$ sudo service network restart
[sudo] password for <current_user>:
Restarting network (via systemctl): [ OK ]
Try to
ping
Google servers again, with no success:
$ ping google.com
ping: google.com: Name or service not known
Check for file
/etc/resolv.conf
:
$ cat /etc/resolv.conf
cat: /etc/resolv.conf: No such file or directory
File doesn't exists anymore - and this is the problem something is deleting it on every reboot
Create the file and add the content of DNS:
$ sudo nano /etc/resolv.conf
Ping Google servers this time with success:
$ ping google.com
PING google.com (216.58.192.110) 56(84) bytes of data.
64 bytes from mia07s35-in-f110.1e100.net (216.58.192.110): icmp_seq=1 ttl=57 time=3.87 ms
Any ideas in what could be happening here?
networking fedora networkmanager dhcp resolv.conf
I am having an issue where DHCP (I though as I read in other similar topics) is clearing the I am not sure about how to deal with this since the post I have found (1, 2 and some others) are for Debian based distros or other but not Fedora./etc/resolv.conf
file on each boot.
This is the output of ifcfg-enp0s31f6
so for sure is DHCP:
cat /etc/sysconfig/network-scripts/ifcfg-enp0s31f6
HWADDR=C8:5B:76:1A:8E:55
TYPE=Ethernet
DEFROUTE=yes
IPV4_FAILURE_FATAL=no
IPV6INIT=no
IPV6_AUTOCONF=no
IPV6_DEFROUTE=no
IPV6_FAILURE_FATAL=no
IPV6_ADDR_GEN_MODE=stable-privacy
NAME=enp0s31f6
UUID=0af812a3-ac8e-32a0-887d-10884872d6c7
ONBOOT=yes
IPV6_PEERDNS=no
IPV6_PEERROUTES=no
BOOTPROTO=dhcp
PEERDNS=yes
PEERROUTES=yes
In the other side I don't know if Network Manager is doing something else around this.
Update: Content of NetworkManager.conf (I have removed the comments since are useless)
$ cat /etc/NetworkManager/NetworkManager.conf
[main]
#plugins=ifcfg-rh,ibft
dns=none
[logging]
#domains=ALL
Can I get some help with this? It's annonying be setting up the file once and once on every reboot.
UPDATE 2
After a month I'm still having the same issue where file gets deleted by "something".
Here is the steps I did follow in order to make a fresh test:
- Reboot the PC
After PC gets restarted open a terminal and try to
ping
Google servers of course without success:
$ ping google.com
ping: google.com: Name or service not known
Check the network configuration were all seems to be fine:
$ cat /etc/sysconfig/network-scripts/ifcfg-enp0s31f6
NAME=enp0s31f6
ONBOOT=yes
HWADDR=C8:5B:76:1A:8E:55
MACADDR=C8:5B:76:1A:8E:55
UUID=0af812a3-ac8e-32a0-887d-10884872d6c7
BOOTPROTO=static
PEERDNS=no
DNS1=8.8.8.8
DNS2=8.8.4.4
DNS3=192.168.1.10
NM_CONTROLLED=yes
IPADDR=192.168.1.66
NETMASK=255.255.255.0
BROADCAST=192.168.1.255
GATEWAY=192.168.1.1
TYPE=Ethernet
DEFROUTE=yes
IPV4_FAILURE_FATAL=no
IPV6INIT=no
Restart the
network
service:
$ sudo service network restart
[sudo] password for <current_user>:
Restarting network (via systemctl): [ OK ]
Try to
ping
Google servers again, with no success:
$ ping google.com
ping: google.com: Name or service not known
Check for file
/etc/resolv.conf
:
$ cat /etc/resolv.conf
cat: /etc/resolv.conf: No such file or directory
File doesn't exists anymore - and this is the problem something is deleting it on every reboot
Create the file and add the content of DNS:
$ sudo nano /etc/resolv.conf
Ping Google servers this time with success:
$ ping google.com
PING google.com (216.58.192.110) 56(84) bytes of data.
64 bytes from mia07s35-in-f110.1e100.net (216.58.192.110): icmp_seq=1 ttl=57 time=3.87 ms
Any ideas in what could be happening here?
networking fedora networkmanager dhcp resolv.conf
networking fedora networkmanager dhcp resolv.conf
edited Apr 13 '17 at 12:36
Community♦
1
1
asked Nov 15 '16 at 15:06
ReynierPM
4071918
4071918
3
mayPEERDNS=no
help you
– Ipor Sircer
Nov 15 '16 at 15:11
@IporSircer no, I have changed the value and restart the PC, same result, no DNS information. BTW do I need to restart the PC orservice network restart
would be enough?
– ReynierPM
Nov 15 '16 at 15:20
Trychattr +i /etc/resolv.conf
– GAD3R
Nov 16 '16 at 19:02
@GAD3R not working:chattr: Operation not supported while reading flags on /etc/resolv.conf
– ReynierPM
Nov 16 '16 at 19:37
Which Fedora version (and Spin/Edition) are you using?
– mattdm
Nov 24 '16 at 18:49
|
show 2 more comments
3
mayPEERDNS=no
help you
– Ipor Sircer
Nov 15 '16 at 15:11
@IporSircer no, I have changed the value and restart the PC, same result, no DNS information. BTW do I need to restart the PC orservice network restart
would be enough?
– ReynierPM
Nov 15 '16 at 15:20
Trychattr +i /etc/resolv.conf
– GAD3R
Nov 16 '16 at 19:02
@GAD3R not working:chattr: Operation not supported while reading flags on /etc/resolv.conf
– ReynierPM
Nov 16 '16 at 19:37
Which Fedora version (and Spin/Edition) are you using?
– mattdm
Nov 24 '16 at 18:49
3
3
may
PEERDNS=no
help you– Ipor Sircer
Nov 15 '16 at 15:11
may
PEERDNS=no
help you– Ipor Sircer
Nov 15 '16 at 15:11
@IporSircer no, I have changed the value and restart the PC, same result, no DNS information. BTW do I need to restart the PC or
service network restart
would be enough?– ReynierPM
Nov 15 '16 at 15:20
@IporSircer no, I have changed the value and restart the PC, same result, no DNS information. BTW do I need to restart the PC or
service network restart
would be enough?– ReynierPM
Nov 15 '16 at 15:20
Try
chattr +i /etc/resolv.conf
– GAD3R
Nov 16 '16 at 19:02
Try
chattr +i /etc/resolv.conf
– GAD3R
Nov 16 '16 at 19:02
@GAD3R not working:
chattr: Operation not supported while reading flags on /etc/resolv.conf
– ReynierPM
Nov 16 '16 at 19:37
@GAD3R not working:
chattr: Operation not supported while reading flags on /etc/resolv.conf
– ReynierPM
Nov 16 '16 at 19:37
Which Fedora version (and Spin/Edition) are you using?
– mattdm
Nov 24 '16 at 18:49
Which Fedora version (and Spin/Edition) are you using?
– mattdm
Nov 24 '16 at 18:49
|
show 2 more comments
8 Answers
8
active
oldest
votes
up vote
5
down vote
In my experience, /etc/resolv.conf
gets regenerated on boot, so any manual changes to it get reset.
To work around this, you can create /etc/resolv.conf.head
(or .tail
depending on which end of the file you want to add to) and insert the custom settings you want in there (usually nameserver
changes). Then the contents of that file gets added automatically when /etc/resolv.conf
is generated by NetworkManager (or whichever service is in charge of the file on your system).
This workaroudnd isn't working either, I've tried and after restart/etc/resolv.conf
is empty
– ReynierPM
Nov 28 '16 at 13:21
add a comment |
up vote
2
down vote
I think you were right on track.
It's working for me now, but I didn't do the:
dns=none
on the:
/etc/sysconfig/network-scripts/ifcfg-enp0s31f6
After I restarted the network manager, it automatically created the resolv:
sudo service NetworkManager restart
I rebooted and it still worked.
add a comment |
up vote
1
down vote
"Have you tried setting your resolv.conf file to have immutability after putting whatever content you want?."
pretty sure this keeps the /etc/dhcp/dhclient.conf from doing its job and your DNS never resolves anyway. At best this is frustrating and at worst freezes things up as your computer continuously tries to run that file and establish a connection. I think the key is in editing "/etc/dhcp/dhclient.conf" instead of resolv.conf directly, as that is the file that writes to resolv.conf on reboot.
Please edit your post to focus on your suggestion (i.e., the last sentence of your answer) and de-emphasize your critique of the other answer.
– G-Man
Aug 11 at 16:38
add a comment |
up vote
0
down vote
Probably NetworkManager is configuring resolve.conf
. if you don't want that, change rc-manager
setting in NetworkManager.conf. See man NetworkManager.conf
.
1
Nop, that's not the problem. I am reading this in docsnone: NetworkManager will not modify resolv.conf. This implies rc-managerunmanaged
and I am seeing this on/etc/NetworkManager/NetworkManager.conf
[main] dns=none
– ReynierPM
Nov 22 '16 at 13:19
add a comment |
up vote
0
down vote
To prevent resolv.conf
to be update at boot time, you should make the following changes:
Change PEERDNS=yes
to PEERDNS=no
PEERDNS=no
This will prevent network service from updating /etc/resolv.conf with the DNS servers received from a DHCP server.
mentioned on @Ipor Sircer comment's
1
PEERDNS
is set tono
(see OP) now willBOOTPROTO=static
change to static IP address instead of dynamic? If that's the case then this will not fix the issue.
– ReynierPM
Nov 28 '16 at 13:17
@ReynierPM right
– GAD3R
Nov 28 '16 at 13:18
I am not using NM at all, I mean is a tool in the GUI but I never touch it, can I disable it to prevent this behavior? People using DHCP on the same office gets DNS and Internet connection so I don't know what is happening here and I am tempted to disable NM, what do you think?
– ReynierPM
Nov 28 '16 at 13:27
@ReynierPM can you add the contents ofNetworkManager.conf
– GAD3R
Nov 28 '16 at 13:40
Done, in the OP
– ReynierPM
Nov 28 '16 at 13:46
|
show 5 more comments
up vote
0
down vote
I had the same problem. It was soved by installing the resolvconf
package. Since I am on Debian I can not test, but may help this tip:
open (or create) as sudo:
/etc/dhcp/dhclient.conf
add:
prepend domain-name-servers 127.0.0.1;
add a comment |
up vote
0
down vote
First You must sure resolvconf service
active.
sudo service resolvconf status
Active: active (exited) since
If the service active
remove resolvconf
:
sudo apt-get purge resolvconf
Then if after remove or this is not active or service not found:
sudo apt-get update
sudo apt-get install resolvconf
Then restart service:
sudo service resolvconf restart
now see the /etc/resolv.conf
:
cat /etc/resolv.conf
Must be exists:
# Dynamic resolv.conf(5) file for glibc resolver(3) generated by
resolvconf(8)
# DO NOT EDIT THIS FILE BY HAND -- YOUR CHANGES WILL BE OVERWRITTEN
# 127.0.0.53 is the systemd-resolved stub resolver.
# run "systemd-resolve --status" to see details about the actual nameservers.
nameserver 127.0.0.1
New contributor
add a comment |
up vote
-2
down vote
Have you tried setting your resolv.conf file to have immutability after putting whatever content you want?.
You may want to use chattr +i /etc/resolv.conf
or with sudo.
By doing this we avoid overwrite.
Unless it is getting deleted, it might give initial insight.
add a comment |
8 Answers
8
active
oldest
votes
8 Answers
8
active
oldest
votes
active
oldest
votes
active
oldest
votes
up vote
5
down vote
In my experience, /etc/resolv.conf
gets regenerated on boot, so any manual changes to it get reset.
To work around this, you can create /etc/resolv.conf.head
(or .tail
depending on which end of the file you want to add to) and insert the custom settings you want in there (usually nameserver
changes). Then the contents of that file gets added automatically when /etc/resolv.conf
is generated by NetworkManager (or whichever service is in charge of the file on your system).
This workaroudnd isn't working either, I've tried and after restart/etc/resolv.conf
is empty
– ReynierPM
Nov 28 '16 at 13:21
add a comment |
up vote
5
down vote
In my experience, /etc/resolv.conf
gets regenerated on boot, so any manual changes to it get reset.
To work around this, you can create /etc/resolv.conf.head
(or .tail
depending on which end of the file you want to add to) and insert the custom settings you want in there (usually nameserver
changes). Then the contents of that file gets added automatically when /etc/resolv.conf
is generated by NetworkManager (or whichever service is in charge of the file on your system).
This workaroudnd isn't working either, I've tried and after restart/etc/resolv.conf
is empty
– ReynierPM
Nov 28 '16 at 13:21
add a comment |
up vote
5
down vote
up vote
5
down vote
In my experience, /etc/resolv.conf
gets regenerated on boot, so any manual changes to it get reset.
To work around this, you can create /etc/resolv.conf.head
(or .tail
depending on which end of the file you want to add to) and insert the custom settings you want in there (usually nameserver
changes). Then the contents of that file gets added automatically when /etc/resolv.conf
is generated by NetworkManager (or whichever service is in charge of the file on your system).
In my experience, /etc/resolv.conf
gets regenerated on boot, so any manual changes to it get reset.
To work around this, you can create /etc/resolv.conf.head
(or .tail
depending on which end of the file you want to add to) and insert the custom settings you want in there (usually nameserver
changes). Then the contents of that file gets added automatically when /etc/resolv.conf
is generated by NetworkManager (or whichever service is in charge of the file on your system).
edited Nov 24 '16 at 10:05
GAD3R
24.6k1749104
24.6k1749104
answered Nov 24 '16 at 10:00
Mioriin
1,694512
1,694512
This workaroudnd isn't working either, I've tried and after restart/etc/resolv.conf
is empty
– ReynierPM
Nov 28 '16 at 13:21
add a comment |
This workaroudnd isn't working either, I've tried and after restart/etc/resolv.conf
is empty
– ReynierPM
Nov 28 '16 at 13:21
This workaroudnd isn't working either, I've tried and after restart
/etc/resolv.conf
is empty– ReynierPM
Nov 28 '16 at 13:21
This workaroudnd isn't working either, I've tried and after restart
/etc/resolv.conf
is empty– ReynierPM
Nov 28 '16 at 13:21
add a comment |
up vote
2
down vote
I think you were right on track.
It's working for me now, but I didn't do the:
dns=none
on the:
/etc/sysconfig/network-scripts/ifcfg-enp0s31f6
After I restarted the network manager, it automatically created the resolv:
sudo service NetworkManager restart
I rebooted and it still worked.
add a comment |
up vote
2
down vote
I think you were right on track.
It's working for me now, but I didn't do the:
dns=none
on the:
/etc/sysconfig/network-scripts/ifcfg-enp0s31f6
After I restarted the network manager, it automatically created the resolv:
sudo service NetworkManager restart
I rebooted and it still worked.
add a comment |
up vote
2
down vote
up vote
2
down vote
I think you were right on track.
It's working for me now, but I didn't do the:
dns=none
on the:
/etc/sysconfig/network-scripts/ifcfg-enp0s31f6
After I restarted the network manager, it automatically created the resolv:
sudo service NetworkManager restart
I rebooted and it still worked.
I think you were right on track.
It's working for me now, but I didn't do the:
dns=none
on the:
/etc/sysconfig/network-scripts/ifcfg-enp0s31f6
After I restarted the network manager, it automatically created the resolv:
sudo service NetworkManager restart
I rebooted and it still worked.
edited May 25 '17 at 23:42
Stephen Rauch
3,308101328
3,308101328
answered May 25 '17 at 22:57
Juan Ramirez
211
211
add a comment |
add a comment |
up vote
1
down vote
"Have you tried setting your resolv.conf file to have immutability after putting whatever content you want?."
pretty sure this keeps the /etc/dhcp/dhclient.conf from doing its job and your DNS never resolves anyway. At best this is frustrating and at worst freezes things up as your computer continuously tries to run that file and establish a connection. I think the key is in editing "/etc/dhcp/dhclient.conf" instead of resolv.conf directly, as that is the file that writes to resolv.conf on reboot.
Please edit your post to focus on your suggestion (i.e., the last sentence of your answer) and de-emphasize your critique of the other answer.
– G-Man
Aug 11 at 16:38
add a comment |
up vote
1
down vote
"Have you tried setting your resolv.conf file to have immutability after putting whatever content you want?."
pretty sure this keeps the /etc/dhcp/dhclient.conf from doing its job and your DNS never resolves anyway. At best this is frustrating and at worst freezes things up as your computer continuously tries to run that file and establish a connection. I think the key is in editing "/etc/dhcp/dhclient.conf" instead of resolv.conf directly, as that is the file that writes to resolv.conf on reboot.
Please edit your post to focus on your suggestion (i.e., the last sentence of your answer) and de-emphasize your critique of the other answer.
– G-Man
Aug 11 at 16:38
add a comment |
up vote
1
down vote
up vote
1
down vote
"Have you tried setting your resolv.conf file to have immutability after putting whatever content you want?."
pretty sure this keeps the /etc/dhcp/dhclient.conf from doing its job and your DNS never resolves anyway. At best this is frustrating and at worst freezes things up as your computer continuously tries to run that file and establish a connection. I think the key is in editing "/etc/dhcp/dhclient.conf" instead of resolv.conf directly, as that is the file that writes to resolv.conf on reboot.
"Have you tried setting your resolv.conf file to have immutability after putting whatever content you want?."
pretty sure this keeps the /etc/dhcp/dhclient.conf from doing its job and your DNS never resolves anyway. At best this is frustrating and at worst freezes things up as your computer continuously tries to run that file and establish a connection. I think the key is in editing "/etc/dhcp/dhclient.conf" instead of resolv.conf directly, as that is the file that writes to resolv.conf on reboot.
answered Aug 11 at 16:00
Necrus
111
111
Please edit your post to focus on your suggestion (i.e., the last sentence of your answer) and de-emphasize your critique of the other answer.
– G-Man
Aug 11 at 16:38
add a comment |
Please edit your post to focus on your suggestion (i.e., the last sentence of your answer) and de-emphasize your critique of the other answer.
– G-Man
Aug 11 at 16:38
Please edit your post to focus on your suggestion (i.e., the last sentence of your answer) and de-emphasize your critique of the other answer.
– G-Man
Aug 11 at 16:38
Please edit your post to focus on your suggestion (i.e., the last sentence of your answer) and de-emphasize your critique of the other answer.
– G-Man
Aug 11 at 16:38
add a comment |
up vote
0
down vote
Probably NetworkManager is configuring resolve.conf
. if you don't want that, change rc-manager
setting in NetworkManager.conf. See man NetworkManager.conf
.
1
Nop, that's not the problem. I am reading this in docsnone: NetworkManager will not modify resolv.conf. This implies rc-managerunmanaged
and I am seeing this on/etc/NetworkManager/NetworkManager.conf
[main] dns=none
– ReynierPM
Nov 22 '16 at 13:19
add a comment |
up vote
0
down vote
Probably NetworkManager is configuring resolve.conf
. if you don't want that, change rc-manager
setting in NetworkManager.conf. See man NetworkManager.conf
.
1
Nop, that's not the problem. I am reading this in docsnone: NetworkManager will not modify resolv.conf. This implies rc-managerunmanaged
and I am seeing this on/etc/NetworkManager/NetworkManager.conf
[main] dns=none
– ReynierPM
Nov 22 '16 at 13:19
add a comment |
up vote
0
down vote
up vote
0
down vote
Probably NetworkManager is configuring resolve.conf
. if you don't want that, change rc-manager
setting in NetworkManager.conf. See man NetworkManager.conf
.
Probably NetworkManager is configuring resolve.conf
. if you don't want that, change rc-manager
setting in NetworkManager.conf. See man NetworkManager.conf
.
edited Nov 28 '16 at 9:06
GAD3R
24.6k1749104
24.6k1749104
answered Nov 22 '16 at 8:10
thaller
54135
54135
1
Nop, that's not the problem. I am reading this in docsnone: NetworkManager will not modify resolv.conf. This implies rc-managerunmanaged
and I am seeing this on/etc/NetworkManager/NetworkManager.conf
[main] dns=none
– ReynierPM
Nov 22 '16 at 13:19
add a comment |
1
Nop, that's not the problem. I am reading this in docsnone: NetworkManager will not modify resolv.conf. This implies rc-managerunmanaged
and I am seeing this on/etc/NetworkManager/NetworkManager.conf
[main] dns=none
– ReynierPM
Nov 22 '16 at 13:19
1
1
Nop, that's not the problem. I am reading this in docs
none: NetworkManager will not modify resolv.conf. This implies rc-managerunmanaged
and I am seeing this on /etc/NetworkManager/NetworkManager.conf
[main] dns=none
– ReynierPM
Nov 22 '16 at 13:19
Nop, that's not the problem. I am reading this in docs
none: NetworkManager will not modify resolv.conf. This implies rc-managerunmanaged
and I am seeing this on /etc/NetworkManager/NetworkManager.conf
[main] dns=none
– ReynierPM
Nov 22 '16 at 13:19
add a comment |
up vote
0
down vote
To prevent resolv.conf
to be update at boot time, you should make the following changes:
Change PEERDNS=yes
to PEERDNS=no
PEERDNS=no
This will prevent network service from updating /etc/resolv.conf with the DNS servers received from a DHCP server.
mentioned on @Ipor Sircer comment's
1
PEERDNS
is set tono
(see OP) now willBOOTPROTO=static
change to static IP address instead of dynamic? If that's the case then this will not fix the issue.
– ReynierPM
Nov 28 '16 at 13:17
@ReynierPM right
– GAD3R
Nov 28 '16 at 13:18
I am not using NM at all, I mean is a tool in the GUI but I never touch it, can I disable it to prevent this behavior? People using DHCP on the same office gets DNS and Internet connection so I don't know what is happening here and I am tempted to disable NM, what do you think?
– ReynierPM
Nov 28 '16 at 13:27
@ReynierPM can you add the contents ofNetworkManager.conf
– GAD3R
Nov 28 '16 at 13:40
Done, in the OP
– ReynierPM
Nov 28 '16 at 13:46
|
show 5 more comments
up vote
0
down vote
To prevent resolv.conf
to be update at boot time, you should make the following changes:
Change PEERDNS=yes
to PEERDNS=no
PEERDNS=no
This will prevent network service from updating /etc/resolv.conf with the DNS servers received from a DHCP server.
mentioned on @Ipor Sircer comment's
1
PEERDNS
is set tono
(see OP) now willBOOTPROTO=static
change to static IP address instead of dynamic? If that's the case then this will not fix the issue.
– ReynierPM
Nov 28 '16 at 13:17
@ReynierPM right
– GAD3R
Nov 28 '16 at 13:18
I am not using NM at all, I mean is a tool in the GUI but I never touch it, can I disable it to prevent this behavior? People using DHCP on the same office gets DNS and Internet connection so I don't know what is happening here and I am tempted to disable NM, what do you think?
– ReynierPM
Nov 28 '16 at 13:27
@ReynierPM can you add the contents ofNetworkManager.conf
– GAD3R
Nov 28 '16 at 13:40
Done, in the OP
– ReynierPM
Nov 28 '16 at 13:46
|
show 5 more comments
up vote
0
down vote
up vote
0
down vote
To prevent resolv.conf
to be update at boot time, you should make the following changes:
Change PEERDNS=yes
to PEERDNS=no
PEERDNS=no
This will prevent network service from updating /etc/resolv.conf with the DNS servers received from a DHCP server.
mentioned on @Ipor Sircer comment's
To prevent resolv.conf
to be update at boot time, you should make the following changes:
Change PEERDNS=yes
to PEERDNS=no
PEERDNS=no
This will prevent network service from updating /etc/resolv.conf with the DNS servers received from a DHCP server.
mentioned on @Ipor Sircer comment's
edited Apr 13 '17 at 12:36
Community♦
1
1
answered Nov 28 '16 at 9:02
GAD3R
24.6k1749104
24.6k1749104
1
PEERDNS
is set tono
(see OP) now willBOOTPROTO=static
change to static IP address instead of dynamic? If that's the case then this will not fix the issue.
– ReynierPM
Nov 28 '16 at 13:17
@ReynierPM right
– GAD3R
Nov 28 '16 at 13:18
I am not using NM at all, I mean is a tool in the GUI but I never touch it, can I disable it to prevent this behavior? People using DHCP on the same office gets DNS and Internet connection so I don't know what is happening here and I am tempted to disable NM, what do you think?
– ReynierPM
Nov 28 '16 at 13:27
@ReynierPM can you add the contents ofNetworkManager.conf
– GAD3R
Nov 28 '16 at 13:40
Done, in the OP
– ReynierPM
Nov 28 '16 at 13:46
|
show 5 more comments
1
PEERDNS
is set tono
(see OP) now willBOOTPROTO=static
change to static IP address instead of dynamic? If that's the case then this will not fix the issue.
– ReynierPM
Nov 28 '16 at 13:17
@ReynierPM right
– GAD3R
Nov 28 '16 at 13:18
I am not using NM at all, I mean is a tool in the GUI but I never touch it, can I disable it to prevent this behavior? People using DHCP on the same office gets DNS and Internet connection so I don't know what is happening here and I am tempted to disable NM, what do you think?
– ReynierPM
Nov 28 '16 at 13:27
@ReynierPM can you add the contents ofNetworkManager.conf
– GAD3R
Nov 28 '16 at 13:40
Done, in the OP
– ReynierPM
Nov 28 '16 at 13:46
1
1
PEERDNS
is set to no
(see OP) now will BOOTPROTO=static
change to static IP address instead of dynamic? If that's the case then this will not fix the issue.– ReynierPM
Nov 28 '16 at 13:17
PEERDNS
is set to no
(see OP) now will BOOTPROTO=static
change to static IP address instead of dynamic? If that's the case then this will not fix the issue.– ReynierPM
Nov 28 '16 at 13:17
@ReynierPM right
– GAD3R
Nov 28 '16 at 13:18
@ReynierPM right
– GAD3R
Nov 28 '16 at 13:18
I am not using NM at all, I mean is a tool in the GUI but I never touch it, can I disable it to prevent this behavior? People using DHCP on the same office gets DNS and Internet connection so I don't know what is happening here and I am tempted to disable NM, what do you think?
– ReynierPM
Nov 28 '16 at 13:27
I am not using NM at all, I mean is a tool in the GUI but I never touch it, can I disable it to prevent this behavior? People using DHCP on the same office gets DNS and Internet connection so I don't know what is happening here and I am tempted to disable NM, what do you think?
– ReynierPM
Nov 28 '16 at 13:27
@ReynierPM can you add the contents of
NetworkManager.conf
– GAD3R
Nov 28 '16 at 13:40
@ReynierPM can you add the contents of
NetworkManager.conf
– GAD3R
Nov 28 '16 at 13:40
Done, in the OP
– ReynierPM
Nov 28 '16 at 13:46
Done, in the OP
– ReynierPM
Nov 28 '16 at 13:46
|
show 5 more comments
up vote
0
down vote
I had the same problem. It was soved by installing the resolvconf
package. Since I am on Debian I can not test, but may help this tip:
open (or create) as sudo:
/etc/dhcp/dhclient.conf
add:
prepend domain-name-servers 127.0.0.1;
add a comment |
up vote
0
down vote
I had the same problem. It was soved by installing the resolvconf
package. Since I am on Debian I can not test, but may help this tip:
open (or create) as sudo:
/etc/dhcp/dhclient.conf
add:
prepend domain-name-servers 127.0.0.1;
add a comment |
up vote
0
down vote
up vote
0
down vote
I had the same problem. It was soved by installing the resolvconf
package. Since I am on Debian I can not test, but may help this tip:
open (or create) as sudo:
/etc/dhcp/dhclient.conf
add:
prepend domain-name-servers 127.0.0.1;
I had the same problem. It was soved by installing the resolvconf
package. Since I am on Debian I can not test, but may help this tip:
open (or create) as sudo:
/etc/dhcp/dhclient.conf
add:
prepend domain-name-servers 127.0.0.1;
edited Feb 10 at 21:41
Jeff Schaller
36.9k1052121
36.9k1052121
answered Feb 10 at 20:03
robert
96113
96113
add a comment |
add a comment |
up vote
0
down vote
First You must sure resolvconf service
active.
sudo service resolvconf status
Active: active (exited) since
If the service active
remove resolvconf
:
sudo apt-get purge resolvconf
Then if after remove or this is not active or service not found:
sudo apt-get update
sudo apt-get install resolvconf
Then restart service:
sudo service resolvconf restart
now see the /etc/resolv.conf
:
cat /etc/resolv.conf
Must be exists:
# Dynamic resolv.conf(5) file for glibc resolver(3) generated by
resolvconf(8)
# DO NOT EDIT THIS FILE BY HAND -- YOUR CHANGES WILL BE OVERWRITTEN
# 127.0.0.53 is the systemd-resolved stub resolver.
# run "systemd-resolve --status" to see details about the actual nameservers.
nameserver 127.0.0.1
New contributor
add a comment |
up vote
0
down vote
First You must sure resolvconf service
active.
sudo service resolvconf status
Active: active (exited) since
If the service active
remove resolvconf
:
sudo apt-get purge resolvconf
Then if after remove or this is not active or service not found:
sudo apt-get update
sudo apt-get install resolvconf
Then restart service:
sudo service resolvconf restart
now see the /etc/resolv.conf
:
cat /etc/resolv.conf
Must be exists:
# Dynamic resolv.conf(5) file for glibc resolver(3) generated by
resolvconf(8)
# DO NOT EDIT THIS FILE BY HAND -- YOUR CHANGES WILL BE OVERWRITTEN
# 127.0.0.53 is the systemd-resolved stub resolver.
# run "systemd-resolve --status" to see details about the actual nameservers.
nameserver 127.0.0.1
New contributor
add a comment |
up vote
0
down vote
up vote
0
down vote
First You must sure resolvconf service
active.
sudo service resolvconf status
Active: active (exited) since
If the service active
remove resolvconf
:
sudo apt-get purge resolvconf
Then if after remove or this is not active or service not found:
sudo apt-get update
sudo apt-get install resolvconf
Then restart service:
sudo service resolvconf restart
now see the /etc/resolv.conf
:
cat /etc/resolv.conf
Must be exists:
# Dynamic resolv.conf(5) file for glibc resolver(3) generated by
resolvconf(8)
# DO NOT EDIT THIS FILE BY HAND -- YOUR CHANGES WILL BE OVERWRITTEN
# 127.0.0.53 is the systemd-resolved stub resolver.
# run "systemd-resolve --status" to see details about the actual nameservers.
nameserver 127.0.0.1
New contributor
First You must sure resolvconf service
active.
sudo service resolvconf status
Active: active (exited) since
If the service active
remove resolvconf
:
sudo apt-get purge resolvconf
Then if after remove or this is not active or service not found:
sudo apt-get update
sudo apt-get install resolvconf
Then restart service:
sudo service resolvconf restart
now see the /etc/resolv.conf
:
cat /etc/resolv.conf
Must be exists:
# Dynamic resolv.conf(5) file for glibc resolver(3) generated by
resolvconf(8)
# DO NOT EDIT THIS FILE BY HAND -- YOUR CHANGES WILL BE OVERWRITTEN
# 127.0.0.53 is the systemd-resolved stub resolver.
# run "systemd-resolve --status" to see details about the actual nameservers.
nameserver 127.0.0.1
New contributor
New contributor
answered Nov 23 at 9:59
A1Gard
1012
1012
New contributor
New contributor
add a comment |
add a comment |
up vote
-2
down vote
Have you tried setting your resolv.conf file to have immutability after putting whatever content you want?.
You may want to use chattr +i /etc/resolv.conf
or with sudo.
By doing this we avoid overwrite.
Unless it is getting deleted, it might give initial insight.
add a comment |
up vote
-2
down vote
Have you tried setting your resolv.conf file to have immutability after putting whatever content you want?.
You may want to use chattr +i /etc/resolv.conf
or with sudo.
By doing this we avoid overwrite.
Unless it is getting deleted, it might give initial insight.
add a comment |
up vote
-2
down vote
up vote
-2
down vote
Have you tried setting your resolv.conf file to have immutability after putting whatever content you want?.
You may want to use chattr +i /etc/resolv.conf
or with sudo.
By doing this we avoid overwrite.
Unless it is getting deleted, it might give initial insight.
Have you tried setting your resolv.conf file to have immutability after putting whatever content you want?.
You may want to use chattr +i /etc/resolv.conf
or with sudo.
By doing this we avoid overwrite.
Unless it is getting deleted, it might give initial insight.
answered Feb 10 at 22:49
Avineshwar
574
574
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.
Some of your past answers have not been well-received, and you're in danger of being blocked from answering.
Please pay close attention to the following guidance:
- 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%2f323446%2ffile-etc-resolv-conf-deleted-on-every-reboot-why-or-what%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
3
may
PEERDNS=no
help you– Ipor Sircer
Nov 15 '16 at 15:11
@IporSircer no, I have changed the value and restart the PC, same result, no DNS information. BTW do I need to restart the PC or
service network restart
would be enough?– ReynierPM
Nov 15 '16 at 15:20
Try
chattr +i /etc/resolv.conf
– GAD3R
Nov 16 '16 at 19:02
@GAD3R not working:
chattr: Operation not supported while reading flags on /etc/resolv.conf
– ReynierPM
Nov 16 '16 at 19:37
Which Fedora version (and Spin/Edition) are you using?
– mattdm
Nov 24 '16 at 18:49