Hostname resolution

I understand that hostname resolution is done via /etc/resolv.conf, but how is this file populated during the installation process?

When I boot up from a USB pendrive the file /etc/resolv.conf is linked to /tmp/bsdinstall_etc/resolv.conf and I can't figure out how this is eventually updated during the installation process..

I'm trying to create a bootable/networkable USB pendrive from a USB installation image and it almost works apart from hostname resolution...
 
There are no reasonable defaults for the contents of the /etc/resolv.conf file, that's why it's not created during the install phase unless you set up the network interface with a static address and you then get asked for the details to fill in. On first boot on a newly installed system if DHCP is used dhclient(8) creates the file using the DNS information it gets from the DHCP server.
 
balanga said:
I understand that hostname resolution is done via /etc/resolv.conf, but how is this file populated during the installation process?
When using DHCP it's the DHCP server that supplies the information and it's added automatically. If it's a static configuration you have to enter the DNS and domain information during the installation process. It's that information that's added.
 
kpa said:
There are no reasonable defaults for the contents of the /etc/resolv.conf file, that's why it's not created during the install phase unless you set up the network interface with a static address and you then get asked for the details to fill in. On first boot on a newly installed system if DHCP is used dhclient(8) creates the file using the DNS information it gets from the DHCP server.

I'm attempting to create a bootable/networkable USB pendrive by manually going through the steps which are done by bsdinstall. I knew that dhclient configured the IP address but wasn't sure how resolv.conf was updated - and still don't since at the time bsdinstall runs the file is linked to some other file.

I'm basically trying to figure out how bsdinstall does this.
 
Back
Top