Linux - NetworkingThis forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
I am working on configuring Raspbian jessie to run as read-only. The only part of the file system that will be writable is /tmp which is mounted as tmpfs. DHCP is configured to write everything in /tmp so the system gets an IP Address from DHCP.
My problem is that the system cannot write to /etc/resolv.conf. I can ping internet IP Addresses, but not domain names. Theres no resolution.
I have created a symbolic link, pointing /etc/resolv.conf to /tmp/resolv.conf. But the issue here is that everything in /tmp is deleted on every boot. And resolv.conf is not created automatically. So theres no file for the system to write to.
I have also tried creating /tmp/resolv.conf using touch /tmp/resolv.conf in /etc/rc.local. The file gets created but theres nothing written in it. When I run dhclient manually after the system has booted, it writes to /tmp/resolv.conf and everything is fine. So I added the command dhclient in /etc/rc.local but it didnt write anything in /tmp/resolv.conf
Im kind of lost here. I need a tidy, proper way of moving resolv.conf to /tmp
Maybe I wasn't clear.
The system gets an IP Address from DHCP. That part is working OK.
The problem is with resolv.conf not containing any DNS server entries, because the file system is read-only.
So I need to somehow move /etc/resolv.conf to /tmp which is writeable, but emptied on each reboot.
The dhclient command invokes the /sbin/dhclient-script from time to time (man dhclient-script) in debian.
Perhaps you could replace the path for /etc/resolv.conf to /tmp/resolv.conf in the script and then give it a try.
ie.
1.modify the /sbin/dhclient-script script.
2. modify /etc/rc.local to contain the following (order matters obv.) :
# touch /tmp/resolv.conf
# dhclient <interface>
Make sure you backup the /sbin/dhclient-script script to a safe place before modifying it.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.