Jump to content
Not connected, Your IP: 54.204.117.206

Recommended Posts

I am having a bit of trouble editing the resolv.conf file.

 

Aparently, I cant edit it manually as suggested on the Arch wiki.

 

"To use alternative DNS servers, edit /etc/resolv.conf and add them to the top of the file so they are used first, optionally removing or commenting out already listed servers."

https://wiki.archlinux.org/index.php/Resolv.conf

 

Although I can open the file and edit it, I can't save the nameservers I entered. (I am as admin with root privileges.)

 

I thought maybe it was being run by another process so I tried lsattr and nothing was holding it. I even ran chattr -i /etc/resolv.conf just to make sure.

 

Still no avail.

Share this post


Link to post

If you were directly editing the file instead try using nano or your favorite editor to edit the /etc/resolv.conf via terminal.

 

via terminal as root/su ect...

 

nano /etc/resolv.conf

nameserver 10.4.0.1

 

 

 

-edited

Share this post


Link to post

every time you connect to the internet the file /etc/resolv.conf is being altered. so any changes you may have made to /etc/resolv.conf will be scrapped and it will re-write the file with probably something like 'nameserver 192.168.1.1' or whatever ip your router is.....you want to prevent that from happening... try this:

disconnect from your network/internet. then open your /etc/resolv.conf and alter it however you like.

after you alter your /etc/resolv.conf file, goto the terminal and type:

sudo chattr +i /etc/resolv.conf

this will lock the /etc/resolv.conf file, no one can edit it. not even a super user do (sudo). (Unless of course you unlock the file). to unlock the file type this in the terminal:

sudo chattr -i /etc/resolv.conf

you will then be able to edit it again, as with your machine too.. after you lock your /etc/resolv.conf file, try re connecting to the internet and it will use your nameserver's you specified in /etc/resolv.conf.

Share this post


Link to post

I am having a bit of trouble editing the resolv.conf file.

 

Aparently, I cant edit it manually as suggested on the Arch wiki.

 

"To use alternative DNS servers, edit /etc/resolv.conf and add them to the top of the file so they are used first, optionally removing or commenting out already listed servers."

https://wiki.archlinux.org/index.php/Resolv.conf

 

Although I can open the file and edit it, I can't save the nameservers I entered. (I am as admin with root privileges.)

 

I thought maybe it was being run by another process so I tried lsattr and nothing was holding it. I even ran chattr -i /etc/resolv.conf just to make sure.

 

Still no avail.

 

If you are trying set up DNS servers for use with AirVPN (?), then I wonder if this post by staff is relevant here:

 

https://airvpn.org/topic/9608-how-to-accept-dns-push-on-linux-systems-with-resolvconf/

Share this post


Link to post

the arch linux article you reference above https://wiki.archlinux.org/index.php/Resolv.conf describes in section 3 why /etc/resolv.conf may be overwritten and hence prior changes lost.  the articlke goes on to describe how to preserve changes to resolv.conf.  i followed the procedure described for preserving resolv.conf changes when using dhcpcd and the procedure work as expected.

Share this post


Link to post

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
  • Security Check
    Play CAPTCHA Audio
    Refresh Image

×
×
  • Create New...