Panduan memulai: Menyiapkan data DNS untuk nama domain dengan Cloud DNS

Halaman ini menjelaskan cara menyiapkan zona terkelola Cloud DNS dan data resource untuk nama domain Anda. Anda akan dipandu dengan contoh pembuatan zona terkelola, lalu menyiapkan data Address (A) dan Canonical Name (CNAME) untuk domain tersebut.


Untuk mengikuti panduan langkah demi langkah untuk tugas ini langsung di Google Cloud konsol, klik Pandu saya:

Pandu saya


Untuk informasi selengkapnya, lihat referensi berikut:

Persyaratan

Panduan memulai ini mengasumsikan bahwa Anda memiliki hal-hal berikut:

  • Nama domain melalui registrar nama domain. Anda dapat mendaftarkan nama domain menggunakan Cloud Domains atau registrar lain pilihan Anda. Cloud Domains memungkinkan Anda mengelola domain menggunakan Cloud Domains API.
  • Instance virtual machine (VM) Windows Server atau Linux.
  • Alamat IP untuk mengarahkan data A zona Anda. Alamat IP yang valid dapat berupa server yang sudah berjalan dan memiliki alamat IP yang dapat Anda gunakan. Misalnya, Anda dapat mengikuti tutorial Menjalankan server Web Apache dasar untuk menyiapkan server web di VM Compute Engine.

Sebelum memulai

  1. Sign in to your Google Cloud account. If you're new to Google Cloud, create an account to evaluate how our products perform in real-world scenarios. New customers also get $300 in free credits to run, test, and deploy workloads.
  2. In the Google Cloud console, on the project selector page, select or create a Google Cloud project.

    Roles required to select or create a project

    • Select a project: Selecting a project doesn't require a specific IAM role—you can select any project that you've been granted a role on.
    • Create a project: To create a project, you need the Project Creator role (roles/resourcemanager.projectCreator), which contains the resourcemanager.projects.create permission. Learn how to grant roles.

    Go to project selector

  3. Verify that billing is enabled for your Google Cloud project.

  4. Make sure that you have the following role or roles on the project: Service Usage Admin, DNS Administrator

    Check for the roles

    1. In the Google Cloud console, go to the IAM page.

      Go to IAM
    2. Select the project.
    3. In the Principal column, find all rows that identify you or a group that you're included in. To learn which groups you're included in, contact your administrator.

    4. For all rows that specify or include you, check the Role column to see whether the list of roles includes the required roles.

    Grant the roles

    1. In the Google Cloud console, go to the IAM page.

      Buka IAM
    2. Pilih project.
    3. Klik Grant access.
    4. Di kolom New principals, masukkan ID pengguna Anda. ID pengguna biasanya adalah alamat email untuk Akun Google.

    5. Di daftar Select a role, pilih peran.
    6. Untuk memberikan peran tambahan, klik Add another role, lalu tambahkan setiap peran tambahan.
    7. Klik Save.
  5. In the Google Cloud console, on the project selector page, select or create a Google Cloud project.

    Roles required to select or create a project

    • Select a project: Selecting a project doesn't require a specific IAM role—you can select any project that you've been granted a role on.
    • Create a project: To create a project, you need the Project Creator role (roles/resourcemanager.projectCreator), which contains the resourcemanager.projects.create permission. Learn how to grant roles.

    Go to project selector

  6. Verify that billing is enabled for your Google Cloud project.

  7. Make sure that you have the following role or roles on the project: Service Usage Admin, DNS Administrator

    Check for the roles

    1. In the Google Cloud console, go to the IAM page.

      Go to IAM
    2. Select the project.
    3. In the Principal column, find all rows that identify you or a group that you're included in. To learn which groups you're included in, contact your administrator.

    4. For all rows that specify or include you, check the Role column to see whether the list of roles includes the required roles.

    Grant the roles

    1. In the Google Cloud console, go to the IAM page.

      Buka IAM
    2. Pilih project.
    3. Klik Grant access.
    4. Di kolom New principals, masukkan ID pengguna Anda. ID pengguna biasanya adalah alamat email untuk Akun Google.

    5. Di daftar Select a role, pilih peran.
    6. Untuk memberikan peran tambahan, klik Add another role, lalu tambahkan setiap peran tambahan.
    7. Klik Save.
  8. Enable the DNS API.

    Roles required to enable APIs

    To enable APIs, you need the Service Usage Admin IAM role (roles/serviceusage.serviceUsageAdmin), which contains the serviceusage.services.enable permission. Learn how to grant roles.

    Enable the API

Membuat zona publik terkelola di Cloud DNS

  1. Di konsol Google Cloud , buka halaman Create a DNS zone.

    Buka Create a DNS zone

  2. Untuk membuat zona DNS publik, klik Create zone.

  3. Untuk Zone type, pilih Public.

  4. Pada kolom Zone name, masukkan my-new-zone.

  5. Pada kolom DNS name, masukkan nama domain yang Anda beli. Masukkan hanya nama domain. Contoh:

    example.com
    
  6. Pada menu drop-down DNSSEC, pilih Off.

  7. Klik Create.

Halaman Zone details akan ditampilkan. Data NS dan SOA default telah dibuat untuk Anda.

Untuk mengedit data, pada halaman Zone details, di akhir baris untuk data yang ingin Anda edit, klik Edit.

Membuat data untuk mengarahkan domain ke alamat IP eksternal

Jika alamat IP Anda dalam format #.#.#.#, itu adalah alamat IPv4 dan Anda perlu membuat data A.

Jika alamat IP Anda dalam format #:#:#:#:#:#:#:#, itu adalah alamat IPv6 dan Anda perlu membuat data AAAA.

  1. Di konsol Google Cloud , buka halaman Cloud DNS.

    Buka Cloud DNS

  2. Klik zona tempat Anda ingin menambahkan kumpulan data.

  3. Klik Add standard.

  4. Pada Resource Record Type, pilih A untuk membuat data A. Pilih AAAA untuk membuat data AAAA.

  5. Pada IPv4 Address atau IPv6 Address, masukkan alamat IP yang ingin Anda gunakan untuk domain ini.

  6. Klik Create.

Membuat data CNAME untuk subdomain www

  1. Di konsol Google Cloud , buka halaman Cloud DNS.

    Buka Cloud DNS

  2. Klik zona tempat Anda ingin menambahkan kumpulan data.

  3. Klik Add standard.

  4. Pada DNS Name, masukkan www.

  5. Pada Resource Record Type, pilih CNAME.

  6. Pada Canonical name, masukkan nama domain, diikuti dengan tanda titik (misalnya, example.com.).

  7. Klik Create.

Update data memerlukan waktu beberapa saat untuk diterapkan, bergantung pada nilai time to live (TTL) dari data. Anda dapat memverifikasi bahwa data DNS berfungsi dengan membuka nama domain dan memastikan bahwa domain tersebut mengarah ke alamat IP Anda.

Mengupdate server nama domain untuk memublikasikan domain Anda

Terakhir, Anda harus mengupdate server nama domain untuk menggunakan Cloud DNS agar data baru dapat dipublikasikan ke internet.

Anda telah berhasil menggunakan Cloud DNS untuk menyiapkan data DNS.

Pembersihan

Agar akun Google Cloud Anda tidak dikenai biaya untuk resource yang digunakan pada halaman ini, ikuti langkah-langkah berikut.

  1. Di konsol Google Cloud , buka halaman Cloud DNS zones.

    Buka Cloud DNS zones

  2. Klik nama zona (my-new-zone) untuk membuka halaman Zone details.

  3. Pilih data A dan CNAME yang telah Anda buat.

  4. Klik Delete record sets.

  5. Buka halaman Cloud DNS zone.

    Buka Cloud DNS zones

  6. Untuk menghapus zona, centang kotak my-new-zone, lalu di akhir baris, klik Delete zone.

Langkah berikutnya