I have looked about on several forums and have not found satisfying answers to this. So I will try here, since you folk seem to be more helpful than most non FreeBSD specific forum folks are.
I have a couple of isp's that I use for different purposes. The problem is each insists on setting my /etc/resolv.conf to their server, and only to it, through dhcp at connection time. Sorry isp's, but those are not the servers I need to use, for reasons I will not elaborate on here. Every time I have to change connections, I have to manually reset resolv.conf. And sometimes this happens when the machines are unattended due to some failure, either mine or the ISP's. Then I get hosed but good by their setting.
First question is: Is there a good way to prevent dhcp from being so "helpful"? I have tried permission settings on both /etc and the file itself, but even when I set world read and nobody write or explore ( execute ), dhcp gets around me and changes it anyway. I have tried setting it immutable, but only fully system immutable seems to protect the file. But then when I DO want to change it it is a MAJOR UNDERTAKING of boot to single user mode, drop the immutable bit, and then continue the boot after resetting the bit to avoid anyone or anything from getting "helpful" again. Ceases to be entertaining after the first few times this has to be done. Any ideas to avoid the hassle while still getting the protection?
I have looked in vain for any documented way to make dhcp change its ways, but the couple of suggestions from non BSD sources, did not work. And I do not want to modify the dhcp process, again because it is potentially a problem during system maintenance, usually just when one is not needed or appreciated.
Second question is: I am able to work around this by overwriting what dhcp has given me, but this is also a manual undertaking at boot time. Therefore, says I, I shall enscript the overwrite to be automatically done at the end of the boot process. As of now /etc/rc.local is supported under the 13.x versions of FreeBSD, and I assume also the 14.x versions ( have not had a chance to test that yet ), but I get the strong feeling that this may be moving more and more in the direction of yet another rc.d script. So ... any feeling for how much longer rc.local might be viable and also whether I should be concentrating on rc.d style scripting instead? Note ... I am not averse to rc.d scripting, but rc.local is more familiar to me at this time.
Thanks for any insights you folk may have to offer!!!
QG
I have a couple of isp's that I use for different purposes. The problem is each insists on setting my /etc/resolv.conf to their server, and only to it, through dhcp at connection time. Sorry isp's, but those are not the servers I need to use, for reasons I will not elaborate on here. Every time I have to change connections, I have to manually reset resolv.conf. And sometimes this happens when the machines are unattended due to some failure, either mine or the ISP's. Then I get hosed but good by their setting.
First question is: Is there a good way to prevent dhcp from being so "helpful"? I have tried permission settings on both /etc and the file itself, but even when I set world read and nobody write or explore ( execute ), dhcp gets around me and changes it anyway. I have tried setting it immutable, but only fully system immutable seems to protect the file. But then when I DO want to change it it is a MAJOR UNDERTAKING of boot to single user mode, drop the immutable bit, and then continue the boot after resetting the bit to avoid anyone or anything from getting "helpful" again. Ceases to be entertaining after the first few times this has to be done. Any ideas to avoid the hassle while still getting the protection?
I have looked in vain for any documented way to make dhcp change its ways, but the couple of suggestions from non BSD sources, did not work. And I do not want to modify the dhcp process, again because it is potentially a problem during system maintenance, usually just when one is not needed or appreciated.
Second question is: I am able to work around this by overwriting what dhcp has given me, but this is also a manual undertaking at boot time. Therefore, says I, I shall enscript the overwrite to be automatically done at the end of the boot process. As of now /etc/rc.local is supported under the 13.x versions of FreeBSD, and I assume also the 14.x versions ( have not had a chance to test that yet ), but I get the strong feeling that this may be moving more and more in the direction of yet another rc.d script. So ... any feeling for how much longer rc.local might be viable and also whether I should be concentrating on rc.d style scripting instead? Note ... I am not averse to rc.d scripting, but rc.local is more familiar to me at this time.
Thanks for any insights you folk may have to offer!!!
QG