change_resolv_conf() function in network-functions corrupts /etc/resolv.conf leaving only option settings

Solution Verified - Updated -


  • The function change_resolv_conf() in /etc/sysconfig/network-scripts/network-functions deletes all rows from /etc/resolv.conf except options when it's defined. For example, consider /etc/resolv.conf has the following contents:

    # cat /etc/resolv.conf
    ; generated by /sbin/dhclient-script
    search csb
    options timeout:1
  • By restarting the network service or recycling a network interface, the contents gets rewritten as follows:

    # cat /etc/resolv.conf
    options timeout:1


  • Red Hat Enterprise Linux 7
    • initscripts-9.49.24-1.el7 (or older)
    • grep version 2.20 (or newer)
  • Red Hat Enterprise Linux 6
    • initscripts < 9.03.49-1.el6 (or older)
    • grep version 2.20 (or newer)

Subscriber exclusive content

A Red Hat subscription provides unlimited access to our knowledgebase, tools, and much more.

Current Customers and Partners

Log in for full access

Log In

New to Red Hat?

Learn more about Red Hat subscriptions

Using a Red Hat product through a public cloud?

How to access this content