Network on a VM
When creating a VM, you need to specify settings for the network interface connected to it: select the subnet to connect the VM to, configure its internal and public IP addresses, and add the necessary security groups. This allows the VM to interact with other services on the intranet and internet.
Security groups are at the Preview stage stage. If they aren't available in your network, all incoming and outgoing traffic will be allowed for the VM and no additional setup is required.
When the network interface is connected, the VM will be assigned the internal IP address in the subnet and FQDN. The public IP address will only be assigned if this was set when creating the VM.
You can find out the IP addresses, FQDN and other information in the management console (go to the Network section on the virtual machine's page). This data can be used to connect to the VM.
On VMs created from public Linux images, the IP address and hostname (FQDN) are not automatically written to the
/etc/hosts file. This can affect the execution of the
You can change the network interface settings on stopped VMs: assign a public IP address, change the subnet, select other security groups, or configure the DNS settings.
Internal IP address
You can specify the internal IP address at which the VM will be accessible after being created. If no internal IP address is specified, it will be assigned automatically.
Only IPv4 addresses are currently supported. Yandex Compute Cloud VMs and DB hosts provide access to and from the internet via public IP addresses only.
The internal IP address can be used to access a VM from another VM. You can use the internal IP address only to connect to the VMs that belong to the same cloud network.
The internal IP address cannot be changed.
Public IP address
You can get a public IP address to access a VM from the internet.
A public IP address is assigned automatically and cannot be chosen. The address is allocated from the Yandex.Cloud address pool.
When a VM is stopped, its public IP address is released, and the next time the VM is started, it gets a new public IP address. When the VM is restarted, its public IP address is saved.
You can make a public IP address static. For more information, see Making a VM's public IP address static.
For more information about IP address pricing, see the section Public IP addresses in the Virtual Private Cloud service documentation.
The VM's public IP address is mapped to its internal IP address via NAT. Therefore, all requests to the VM from the external IP address are sent to the internal IP address. For more information about NAT, see RFC 3022.
Hostname and FQDN
When creating a VM, it is assigned a hostname and FQDN. You can use the FQDN to access a VM from another VM within the same cloud network.
You can specify a VM's hostname when creating it. Based on the hostname and region, the fully qualified domain name (FQDN) will be generated in the following format:
For example, if you specified the hostname
myinstance, the FQDN will be like this:
The VM name is used to generate the FQDN only once, when creating the VM. If the FQDN is important to you, choose an appropriate name for the VM at the creation stage.
If no hostname is specified, the VM's ID will be used as its hostname. In this case, the region is omitted, because the VM's ID is unique within the entire Yandex.Cloud.
After the network interface is connected to a VM, it will be assigned the MAC address of the device.
You can find out the MAC address from inside the VM or in the resource information using the Yandex.Cloud API.