How to add host mapping to /etc/host of the minikube?

by margarett , in category: General Help , 3 months ago

How to add host mapping to /etc/host of the minikube?

Facebook Twitter LinkedIn Telegram Whatsapp

1 answer


by lonzo , 3 months ago


To add a host mapping to the "/etc/hosts" file of Minikube, you can follow these steps:

  1. Start the Minikube cluster: minikube start
  2. Open a terminal session to the Minikube VM: minikube ssh
  3. Switch to the root user to have the necessary permissions: sudo -i
  4. Edit the "/etc/hosts" file using a text editor like vi or nano: vi /etc/hosts
  5. Add the host mapping to the file. For example, to map "" to an IP address of "", add the following line:
  6. Save and exit the file.
  7. Verify that the host mapping has been added correctly: cat /etc/hosts The output should include the line you added.
  8. Exit the root user and Minikube VM: exit exit

That's it! The host mapping should now be available in Minikube.