Having issue in resolv.conf
hi,
i am using lamp server on Cent os 5.5, but there is issue with my resolv.conf file. after every reboot or restart of network service i need to edit the nameserver details. how can i make resolv.conf file permanent after editing. :banghead: |
Quote:
it seems to have worked for me, more info here: https://wiki.archlinux.org/index.php/Resolv.conf |
Check in /etc/sysconfig/ or the config for dhclient for a setting on whether dhclient updates /etc/resolv.conf. Also Better yet, don't use dhclient on a server. All servers should have static addresses.
You can also change the attribute of the file to prevent modifying. Before resorting to this, check the boot logs for messages about modifying resolv.conf. |
A quick-and-dirty way of doing it, when all else fails:
chattr +i /etc/resolv.conf This can be reverted with chattr -i quite predictably :) |
i have used "chattr +i /etc/resolv.conf" but it is not working in my case. is any thing else which can sort out my issue?
|
Quote:
It seems as if you are using dhcp. The dhcp server appears to be resetting your resolv.conf file each time you restart. Try setting a fixed i.p. address for the network card. |
The chattr problem may be due to the mount options used for the filesystem. Try adding the user_xattr option.
I second the idea of setting your network options; IP address, netmask, default gateway settings. One should be able to depend on a server's IP address. Then don't start the dhcp client service, or even uninstall it. |
i have configured fixed ip for my server but there is no change in my issue.
|
I am not sure if this is available on CentOS, but in slackware there is /etc/resolv.conf.head.
whatever you put there will be added on top to the overwritten /etc/resolv.conf Ofcourse changing permissions or trying this is not the perfect solution. |
Quote:
|
not working yet, some one tell me is there any other way to resolve this problem.
|
no one can help me out in this?????
:confused: |
Doh, since the chattr trick doesn't work, you can put in /etc/rc.local the following
Code:
echo "nameserver x.x.x.x" > /etc/resolv.conf Code:
cat /home/user/resolv.conf > /etc/resolv.conf |
Quote:
|
Quote:
Anyway, have you looked at this approach Regards |
All times are GMT -5. The time now is 06:16 PM. |