Administer > Administer the Container Deployment Foundation > Set up a host name resolution using a hosts file

Set up a host name resolution using a hosts file

 

When you want to access a machine within or outside the cluster from a pod of the node cluster via a FQDN, follow the steps below to set up a host name resolution using a hosts file.

  1. Navigate to the CDF NFS volume directory with the following command:

    cd /var/vols/itom/core/baseinfra-1.0

  1. Go to the DNS host folder with the following command:

    cd kube-dns-hosts

  1. Create a hosts file with the following command:

    vi hosts

  1. Add the host name and IP address of the machine to the file. For example:

    example.me.com 16.155.198.76

  1. Run the following commands on the master nodes to restart the Kubernetes service:

    cd /var/opt/kubernetes/bin

    ./kube-restart.sh

    Then you can access the machine via the FQDN.