How to add additional search domains and nameservers in OCP 4

Solution Verified - Updated -

Issue

  • How to add additional search domain for the cluster DNS in order to resolve domains that belong to the cluster base domain in OCP IPI installation.
  • The Domain Search List provided by DHCP does not contain all the required domains. How can we add additional?
  • Is it possible to modify the domain search in /etc/resolv.conf?
  • After an application is migrated to OpenShift they are failing to connect to outside resources due to the application not being configured to use fully qualified domain names.
  • Is it possible to modify the nameservers in /etc/resolv.conf?
  • Updating nameservers by creating machine configs causing MCP to go into a degraded state causing the below errors:

    E0928 15:37:57.579907    3108 writer.go:135] Marking Degraded due to: unexpected on-disk state validating against rendered-infra-cd76ce447a127cf588ccc839140855f8
    I0928 15:38:05.618367    3108 daemon.go:771] Current config: rendered-infra-19f5b87200b70348e167ddd9f3fe3138
    I0928 15:38:05.618396    3108 daemon.go:772] Desired config: rendered-infra-cd76ce447a127cf588ccc839140855f8
    I0928 15:38:05.631354    3108 update.go:1404] Disk currentConfig rendered-infra-cd76ce447a127cf588ccc839140855f8 overrides node annotation rendered-infra-19f5b87200b70348e167ddd9f3fe3138
    I0928 15:38:05.635347    3108 daemon.go:1014] Validating against pending config rendered-infra-cd76ce447a127cf588ccc839140855f8
    E0928 15:38:06.388077    3108 daemon.go:1413] content mismatch for file /etc/resolv.conf (-want +got):
    bytes.Join({
    -       "search example.com",
    +       "# Generated by KNI resolv prepender NM dispatcher script",
    +       "search test.example.com",
    +      "nameserver 5.6.7.8",
            "nameserver 1.2.3.4,
    

Environment

  • Red Hat OpenShift Container Platform (RHOCP)
    • 4.x

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