Skip to content

DNS Name Resolution Configuration on RHEL/Rocky Linux

To install and configure Anyware Connector on the RHEL or Rocky Linux machine, its important to have a connection between the machine and the Active Directory Domain Controller.

Check that the DNS Name Resolution works as expected

  1. Check the /etc/resolv.conf file to ensure that the desired DNS servers and search suffixes are present.

    cat /etc/resolv.conf
    # Generated by NetworkManager
    search example-domain.com
    nameserver 10.162.0.42
    
  2. Test the DNS by pinging the Domain, in this example example-domain.com:

    ping example-domain.com
    
  3. If the response is successful, you should receive a message similar to the example below:

    PING example-domain.com (10.162.0.42): 56 data bytes
    64 bytes from 10.162.0.42: icmp_seq=0 ttl=118 time=16.622 ms
    64 bytes from 10.162.0.42: icmp_seq=1 ttl=118 time=50.675 ms
    64 bytes from 10.162.0.42: icmp_seq=2 ttl=118 time=27.682 ms
    64 bytes from 10.162.0.42: icmp_seq=3 ttl=118 time=19.886 ms
    ^C
    --- example-domain.com ping statistics ---
    4 packets transmitted, 4 packets received, 0.0% packet loss
    
  4. Restart the Virtual Machine(VM) and check if the DNS settings in /etc/resolv.conf persist and that you can still ping the domain as shown in steps 2-3 above. If it does not work, please follow the steps in Configure DNS Settings below.

Applying Host VM's DNS settings to K3S

The host Virtual Machine's DNS settings are copied from /etc/resolv.conf and applied to the Anyware Manager and/or Connector whichever is installed when the K3S service starts. Hence, it is important that settings are correct after a restart. You will either need to reboot the VM or restart the K3S service to apply the DNS settings to the Anyware Manager or Connector whichever is installed, if changes are made post installation or configuration.

Configure DNS settings

If the DNS Name resolution work as expected, please skip the steps below.

To ensure DNS settings are configured properly on the machine for Anyware Manager or Connector to operate, please perform the following steps(the sample IP of the Domain Controller is 10.162.0.42 for example-domain.com.):

  1. Disable auto-configuration of DNS settings bto prevent overwriting on reboot. In this example the device name is eth0.

    nmcli device modify eth0 ipv4.ignore-auto-dns yes
    
    You also need to disable this on the connection level in some cases. In this example the connection name is eth0.

    nmcli connection modify eth0 ipv4.ignore-auto-dns yes
    
  2. Add the DNS1 for the IP address for Active Directory's DNS server (typically the Domain Controller itself) and optionally DNS2 for fallback DNS server and optionally DOMAIN for a DNS suffix (typically the Domain name) in the network configuration scripts.

    sudo vi /etc/sysconfig/network-scripts/ifcfg-eth0
    TYPE=Ethernet
    PROXY_METHOD=none
    BROWSER_ONLY=no
    BOOTPROTO=dhcp
    DEFROUTE=yes
    IPV4_FAILURE_FATAL=no
    IPV6INIT=yes
    IPV6_AUTOCONF=yes
    IPV6_DEFROUTE=yes
    IPV6_FAILURE_FATAL=no
    NAME=ens192
    UUID=dfe16427-21f1-429c-99cb-a1e9b42be181
    DEVICE=ens192
    ONBOOT=yes
    DNS1=10.162.0.42
    DOMAIN=example-domain.com
    PEERDNS=no
    
  3. Restart the Network Manager.

    sudo systemctl restart NetworkManager
    
  4. Follow steps in the Check that the DNS Name Resolution works properly section to confirm the DNS name resolution works properly.