Provisioning Issue: dracut not writing /etc/resolv.conf correctly

Problem: Trying to kickstart a RHEL7 machine, but dracut can’t resolve my Foreman URL. In the dracut shell I see my /etc/resolv.conf is not correct. I see my Foreman server’s IP address as the only nameserver entry.

Expected outcome: The dracut should show the nameservers I specify in /etc/resolv.conf (which should allow the Foreman URL to resolve for the curl and continue on with the Kickstart).

Foreman and Proxy versions: Foreman v 1.19.1

Other relevant data:
My PXELinux template looks correct. When I review the template for the host I see the ks= pointing to my foreman URL (with the unattended/provision?token= portion) and I see my two nameserver statements pointing to the correct IPs for the DNS servers on my network.

However, when dracut fails and I drop into the shell, the /etc/resolv.conf has my Foreman IP instead of the DNS servers I’ve specified.

I’m not sure how dracut even got my Foreman IP. Did it somehow actually resolve my Foreman URL against the correct nameservers and then put that in /etc/resolv.conf?

My understanding is that dracut should generate the /etc/resolv.conf using the nameserver settings. I see those nameserver settings, with my DNS IPs, in the command line that shows up in the dracut “sos” log… So I’m really unclear where I’m going wrong.

Hi,

I’m not 100% sure but I would guess that your Foreman Server is sent as DNS Server via DHCP.
Could you validate that? I would guess that DNS Servers from DHCP override the ones specified in PXELinux config.

I think you may be onto something…

I checked in my /etc/dhcp/dhcpd.conf on the Foreman server, and it does indeed have my Foreman IP in the “option domain-name-servers” line.

I’m surprised that this would override the settings that get passed to dracut, but I’m going to try modifying this and will check back in if this is the solution.

Thank you very much, I had not thought to look in here!

Yes, this was exactly it! I never would have thought to look in here. It’s interesting that the DHCP settings would override what’s passed to dracut…

Thank you! This has been a head banger for the last few days.

Just in case others are interested in the steps I took to resolve:

  • Modify /etc/dhcp/dhcpd.conf on my Foreman server
  • The line “option domain-name-servers” was modified to use my DNS servers
  • Restart dhcpd service
  • Kickstart succeeds
1 Like