Setting up 3 Virtual Machines running Rocky Linux 8: VM1 ↔ VM2 ↔ Nat Network ↔ VM3
In this article, we will discuss how to resolve DNS issues in Rocky Linux 8 virtual machines. We will set up three virtual machines: VM1, VM2, and VM3. VM1 will be connected to VM2, VM2 will be connected to the Nat Network, and VM3 will be connected to VM2.
Prerequisites
Before we begin, ensure that you have the following:
- Three Rocky Linux 8 virtual machines (VM1, VM2, and VM3)
- VirtualBox or any other preferred virtualization software
- Basic knowledge of Rocky Linux 8 and its network settings
Ping Test using IP Addresses
To test the connectivity between the virtual machines, we will use the ping command with IP addresses. Let's assume the following IP addresses:
- VM1: 192.168.1.101
- VM2: 192.168.1.102
- VM3: 192.168.1.103
Resolving DNS Issues in Rocky Linux 8
When setting up virtual machines, DNS issues can occur due to various reasons, such as incorrect DNS server settings, firewall rules, or network misconfigurations. Let's explore some common DNS issues and their solutions.
1. Checking DNS Server Settings
The first step is to check the DNS server settings on each virtual machine. Open the /etc/resolv.conf file in a text editor and verify the DNS server IP addresses:
# cat /etc/resolv.conf
nameserver 8.8.8.8
nameserver 8.8.4.4
2. Checking Firewall Rules
Firewall rules can also block DNS traffic. To check the firewall rules, use the following command:
# firewall-cmd --list-all
If you find that the DNS traffic is blocked, add the following rule:
# firewall-cmd --permanent --add-service=dns
3. Checking Network Interfaces
Ensure that the network interfaces are properly configured. Use the following command to check the network interfaces:
# ip a
Verify that the virtual machines have the correct IP addresses and that they are connected to the correct network.
In this article, we learned how to set up three Rocky Linux 8 virtual machines and resolve DNS issues between them. We covered checking DNS server settings, firewall rules, and network interfaces. By following these steps, you can ensure that your virtual machines can communicate with each other using their IP addresses.