nixCraft Linux Forum

nixCraft

Linux / UNIX Tech Support Forum

Ubuntu etc resolv conf (/etc/resolv.conf)

This is a discussion on Ubuntu etc resolv conf (/etc/resolv.conf) within the Ubuntu / Debian forums, part of the Linux Distribution category; My /etc/resolv.conf is not writable. How do I make it writable and what is the format for the same without ...


Go Back   nixCraft Linux Forum > Linux Distribution > Ubuntu / Debian

Linux answers from nixCraft.


Ubuntu / Debian Discussion about Debian or Ubuntu Linux related problems.

Reply

 

LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 22-06-2009, 06:21 AM
raj's Avatar
raj raj is offline
Senior Member
User
 
Join Date: Jun 2005
Location: Hyderabad
OS: Fedora, Debian Linux
Posts: 307
Thanks: 42
Thanked 8 Times in 8 Posts
Rep Power: 6
raj will become famous soon enough raj will become famous soon enough
Default Ubuntu etc resolv conf (/etc/resolv.conf)

My /etc/resolv.conf is not writable. How do I make it writable and what is the format for the same without GUI editor for dns?
__________________
Raj
Linux rulz.
I have never turned back in my life ; I shall not do so today.. haha
Reply With Quote
  #2 (permalink)  
Old 23-06-2009, 04:15 AM
nixcraft's Avatar
Never say die
User
 
Join Date: Jan 2005
Location: BIOS
OS: RHEL
Scripting language: Bash and Python
Posts: 2,710
Thanks: 11
Thanked 245 Times in 184 Posts
Rep Power: 10
nixcraft has a reputation beyond repute nixcraft has a reputation beyond repute nixcraft has a reputation beyond repute nixcraft has a reputation beyond repute nixcraft has a reputation beyond repute nixcraft has a reputation beyond repute nixcraft has a reputation beyond repute nixcraft has a reputation beyond repute nixcraft has a reputation beyond repute nixcraft has a reputation beyond repute nixcraft has a reputation beyond repute
Default

Here is my file
Code:
 cat /etc/resolv.conf
Output:
Code:
nameserver 127.0.0.1
nameserver 192.168.0.1
nameserver 4.2.2.1
Make sure root has access /etc/resolv.conf as 0755:
Code:
chmod 0755 /etc/resolv.conf
ls -l /etc/resolv.conf
Make sure file is not write protected see
http://www.cyberciti.biz/tips/linux-password-trick.html
__________________
Vivek Gite
Linux Evangelist
Be proud RHEL user, and let the world know about your enterprise choices! Join RedHat user group.
Always use CODE tags for posting system output and commands!
Do you run a Linux? Let's face it, you need help
Reply With Quote
  #3 (permalink)  
Old 05-07-2009, 07:09 PM
Junior Member
User
 
Join Date: Jul 2009
OS: Debian
Posts: 6
Thanks: 0
Thanked 0 Times in 0 Posts
Rep Power: 0
Action is on a distinguished road
Default

Quote:
Originally Posted by nixcraft View Post
Here is my file
Code:
 cat /etc/resolv.conf
Output:
Code:
nameserver 127.0.0.1
nameserver 192.168.0.1
nameserver 4.2.2.1
Make sure root has access /etc/resolv.conf as 0755:
Code:
chmod 0755 /etc/resolv.conf
ls -l /etc/resolv.conf
Make sure file is not write protected see
Linux Password trick with immutable bit using chattr command
One question: isn't it better to set 644 for security reasons?
Reply With Quote
  #4 (permalink)  
Old 05-07-2009, 07:24 PM
nixcraft's Avatar
Never say die
User
 
Join Date: Jan 2005
Location: BIOS
OS: RHEL
Scripting language: Bash and Python
Posts: 2,710
Thanks: 11
Thanked 245 Times in 184 Posts
Rep Power: 10
nixcraft has a reputation beyond repute nixcraft has a reputation beyond repute nixcraft has a reputation beyond repute nixcraft has a reputation beyond repute nixcraft has a reputation beyond repute nixcraft has a reputation beyond repute nixcraft has a reputation beyond repute nixcraft has a reputation beyond repute nixcraft has a reputation beyond repute nixcraft has a reputation beyond repute nixcraft has a reputation beyond repute
Default

Yes rw r r (0644) is sufficient permission for resolv.conf.
__________________
Vivek Gite
Linux Evangelist
Be proud RHEL user, and let the world know about your enterprise choices! Join RedHat user group.
Always use CODE tags for posting system output and commands!
Do you run a Linux? Let's face it, you need help
Reply With Quote
  #5 (permalink)  
Old 05-07-2009, 07:41 PM
Junior Member
User
 
Join Date: Jul 2009
OS: Debian
Posts: 6
Thanks: 0
Thanked 0 Times in 0 Posts
Rep Power: 0
Action is on a distinguished road
Default

Quote:
Originally Posted by nixcraft View Post
Yes rw r r (0644) is sufficient permission for resolv.conf.
Thanks. One more question, think it has also to do with resolv.conf or so: I have Debian (etch), DynDNS, BIIND9. When doing nslookup it works correctly and resolves my DynDNS domain name to the actual IP addres of my machnie, but when trying to ping, it shows another IP address, and 100% packet loss. I tried restarting bind9 and resolvconf but it doesn't help. What might be the problem and what - the solution?
Thanks in advance
By the way: nice site. +10
Reply With Quote
  #6 (permalink)  
Old 05-07-2009, 07:54 PM
nixcraft's Avatar
Never say die
User
 
Join Date: Jan 2005
Location: BIOS
OS: RHEL
Scripting language: Bash and Python
Posts: 2,710
Thanks: 11
Thanked 245 Times in 184 Posts
Rep Power: 10
nixcraft has a reputation beyond repute nixcraft has a reputation beyond repute nixcraft has a reputation beyond repute nixcraft has a reputation beyond repute nixcraft has a reputation beyond repute nixcraft has a reputation beyond repute nixcraft has a reputation beyond repute nixcraft has a reputation beyond repute nixcraft has a reputation beyond repute nixcraft has a reputation beyond repute nixcraft has a reputation beyond repute
Default

Quote:
Originally Posted by Action View Post
Thanks. One more question, think it has also to do with resolv.conf or so: I have Debian (etch), DynDNS, BIIND9. When doing nslookup it works correctly and resolves my DynDNS domain name to the actual IP addres of my machnie, but when trying to ping, it shows another IP address, and 100% packet loss. I tried restarting bind9 and resolvconf but it doesn't help. What might be the problem and what - the solution?
Thanks in advance
By the way: nice site. +10
Look like caching issue to me. Use dig to trace problem:
Code:
dig your.dnydns.com A +trace
BIND9 is working as a caching server for local lan? If so this can be fixed by flushing cache:
Code:
sudo /etc/init.d/nscd restart 
sudo /etc/init.d/named restart
__________________
Vivek Gite
Linux Evangelist
Be proud RHEL user, and let the world know about your enterprise choices! Join RedHat user group.
Always use CODE tags for posting system output and commands!
Do you run a Linux? Let's face it, you need help
Reply With Quote
  #7 (permalink)  
Old 05-07-2009, 08:00 PM
Junior Member
User
 
Join Date: Jul 2009
OS: Debian
Posts: 6
Thanks: 0
Thanked 0 Times in 0 Posts
Rep Power: 0
Action is on a distinguished road
Default

Quote:
Originally Posted by nixcraft View Post
Look like caching issue to me. Use dig to trace problem:
Code:
dig your.dnydns.com A +trace
BIND9 is working as a caching server for local lan? If so this can be fixed by flushing cache:
Code:
sudo /etc/init.d/nscd restart 
sudo /etc/init.d/named restart
Code:
; <<>> DiG 9.3.4-P1.1 <<>> port.selfip.org A +trace
;; global options:  printcmd
.			517026	IN	NS	ns7.opennic.glue.
.			517026	IN	NS	ns21.opennic.glue.
.			517026	IN	NS	ns22.opennic.glue.
.			517026	IN	NS	ns1.opennic.glue.
.			517026	IN	NS	ns2.opennic.glue.
.			517026	IN	NS	ns5.opennic.glue.
.			517026	IN	NS	ns6.opennic.glue.
;; Received 262 bytes from 127.0.0.1#53(127.0.0.1) in 0 ms

and it tells that it could not get address for ns5/ns7.opennic.glue. Should I remove anything about .glue zone form the BIND9 config? I anyway cannot get it working - the forwarders do resolve opennic.glue, but the local name server doesn't.
Reply With Quote
Reply

Tags
/etc/resolv.conf , linux , networking , ubuntu


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)

 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads

Thread Thread Starter Forum Replies Last Post
getting errors from named.conf in rhel5 ashu.wifi CentOS / RHEL / Fedora 2 17-09-2008 02:02 PM
httpd.conf deleted! How to re-generate? Any Scripts? vivekv Shell scripting 1 17-07-2008 05:13 PM
atal error. /etc/modules.conf not found ppnair CentOS / RHEL / Fedora 5 01-03-2008 09:06 PM
httpd.conf deleted! How to re-generate? vivekv Getting started tutorials 2 17-01-2008 03:45 PM
How to add MIB's in snmpd.conf file manish_2479 Networking, Firewalls and Security 0 10-07-2007 01:26 AM


All times are GMT +5.5. The time now is 10:33 AM.


Powered by vBulletin® Version 3.8.5 - Copyright ©2000 - 2010, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.3.2
©2005-2010 nixCraft. All rights reserved

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38