Feature #18509

Modify kickstart templates to update the /etc/hosts and /etc/resolv.conf

Added by Marek Hulán over 4 years ago. Updated over 1 year ago.

Target version:
Bugzilla link:
Fixed in Releases:
Found in Releases:


Cloned from

Description of problem:
Default kicstart finish templates are not updating the /etc/hosts and /etc/resolv.conf files. This creates additional useless effort to configure the host later via puppet or any other configuration management tool.

Version-Release number of selected component (if applicable):
All foreman releases

How reproducible:

Steps to Reproduce:
  1. Provision a new host with static IPs
  2. Check if the /etc/hosts file contains the hostname and the IP of the new server (it's not)
  3. Check if the /etc/resolv.conf is populated.

Actual results:

Expected results:
/etc/hosts should be updated with the IP, hostname and short hostname of the new server if the IP is static.
/etc/resolv.conf should contain the DNS servers set during provisioning time.

Foreman has all the necessary information to do so, and there is no reason to write custom snippets to do that.


#1 Updated by Marek Hulán over 4 years ago

  • Subject changed from Modify kickstart templates to update the /etc/hosts and /etc/resolv.conf to Modify kickstart templates to update the /etc/hosts and /etc/resolv.conf
  • Category changed from TFTP to Templates
  • Target version set to 115

#2 Updated by Marek Hulán over 4 years ago

resolv.conf is updated by network manager if DNS1/DNS2 is set according to subnet, but configuring hostname sounds reasonable to me

#3 Updated by The Foreman Bot over 4 years ago

  • Status changed from New to Ready For Testing
  • Assignee set to Marek Hulán
  • Pull request added

#4 Updated by Lukas Zapletal over 1 year ago

  • Triaged set to No
  • Status changed from Ready For Testing to Rejected

It is assumed that hosts managed by Foreman have proper DNS, therefore no changes of `/etc/hosts` is necessary. Some users tend to manage hosts file entries instead of DNS, then configuration management should be used. However, feel free to send a patch to Foreman templates to do this during provisioning, but only as opt-in via parameter. By default, we do not want to change what OS installers set.

File `/etc/resolv.conf` is managed by NetworkManager from CentOS 6, there is no need of changing it directly. Nameservers must be set in ifcfg setting (DNS1, DNS2) or interactively via NetworkManager CLI, TUI or applet.

Also available in: Atom PDF