How does resolv.conf get populated on installation of a new OS?

2

I just installed a new VM, and looked in the resolve.conf file , in order to check on some issues related to DNS resolution.

$ more /etc/resolv.conf
; generated by /sbin/dhclient-script
search uchc.edu
nameserver 10.3.8.10
nameserver 10.3.8.12
nameserver 155.37.50.100

I noticed that , somehow, the resolv.conf is smart enough to add the "search uchc.edu" line, which is appropriate. I always assumed that our networking folks edited startup files for us... But now, I'm realizing that maybe there is some sophisticated logic to how the resolv.conf get auto created by the OS networking utilities on startup.

So my question is : How is it that resolv.conf is first initialized in linux ? Are there specific programs that run in the kernel that set the parameters for resolv.conf ?

Thanks! And please forgive my ignorance - im more of a software developer than a systems guy.... but im trying to catch up.

jayunit100

Posted 2011-11-02T16:22:58.690

Reputation: 441

This is off-topic for SO, but the answer is: You're set up to use a dynamic IP and the DHCP server for your network responds with all that info (along with the IP address for your machine). – None – 2011-11-02T16:29:43.893

3The comment in the second line says it all. – Maxim Egorushkin – 2011-11-02T16:52:57.720

Wow -- it seems like a very relevant question because many coders , like me, must nowadays develop against a VM and know how the VM is setting its network up, so that they can reliably connect to it from a host machine. I would plead others to keep it open. – None – 2011-11-02T18:13:29.677

Answers

5

Your local DHCP server has been configured with those settings, and sends them to every client when it gives out an IP address.

Alnitak

Posted 2011-11-02T16:22:58.690

Reputation: 656