Create a public DNS zone
The zone name needs a trailing dot; after that, delegate NS records at your registrar.
yc dns zone create --name myzone --zone example.com. --public-visibility
- tool
- yc32 commands
More yc commands
-
yc dns zone add-records --name myzone --record '@ 600 A 1.2.3.4'Add an A record for the zone apex with a 600 s TTL; @ means the zone root.
-
yc compute instance create --name web-1 --zone ru-central1-a --network-interface subnet-name=sub-a,nat-ip-version=ipv4 --create-boot-disk image-family=ubuntu-2204-lts,size=20 --metadata-from-file user-data=cloud-init.yamlStart a VM with a public NAT IP and set it up with cloud-init user-data.
-
yc managed-postgresql cluster create --name <name> --environment production --postgresql-version 16 --network-name <name> --host zone-id=ru-central1-a,subnet-name=<name> --resource-preset s3-c2-m8 --disk-size 50 --disk-type network-ssdCreate a PG16 cluster with one host (add more --host flags for HA); for production, use an s3 preset, not a burstable b-class one.
-
yc managed-postgresql cluster list-hosts --cluster-name <name> --format json | jq -r '.[] | "\(.name)\t\(.role)\t\(.health)"'Show host FQDNs with their MASTER/REPLICA role and health to know where to connect.
-
yc managed-postgresql user create <name> --cluster-name <name> --password-stdin && yc managed-postgresql database create <name> --cluster-name <name> --owner <name>Create a user with the password from stdin, then a database owned by that user; --password-stdin keeps the password out of shell history.