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. Halaman ini memandu Anda melalui contoh pembuatan zona terkelola, lalu menyiapkan data Alamat (A) dan Nama Kanonis (CNAME) untuk domain.


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

Pandu saya


Untuk mengetahui informasi selengkapnya, baca referensi berikut:

Persyaratan

Panduan memulai ini mengasumsikan bahwa Anda memiliki hal berikut:

  • Nama domain melalui registrar nama domain. Anda dapat mendaftarkan nama domain menggunakan Cloud Domains atau registrar domain lain pilihan Anda. Cloud Domains dapat Anda gunakan untuk mengelola domain menggunakan Cloud Domains API.
  • Instance virtual machine (VM) Windows Server atau instance VM Linux.
  • Alamat IP untuk mengarahkan data A zona Anda. Alamat IP yang valid dapat berupa server yang sudah Anda jalankan dengan alamat IP yang dapat Anda tunjuk. Misalnya, Anda dapat mempelajari tutorial Menjalankan server Web Apache dasar untuk memulai 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. Biasanya, ini 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. Biasanya, ini 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. Di kolom Zone name, masukkan my-new-zone.

  5. Di kolom DNS name, masukkan nama domain yang Anda beli. Masukkan nama domain saja. Contoh:

    example.com
    
  6. Di 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, di 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 berada dalam format #.#.#.#, Anda memiliki alamat IPv4 dan perlu membuat data A.

Jika alamat IP Anda berada dalam format #:#:#:#:#:#:#:#, Anda memiliki alamat IPv6 dan 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. Untuk Resource Record Type, guna membuat data A, pilih A. Untuk membuat data AAAA, pilih AAAA.

  5. Untuk Alamat IPv4 atau Alamat IPv6, masukkan alamat IP yang ingin Anda gunakan dengan 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. Untuk DNS Name, masukkan www.

  5. Untuk Resource Record Type, pilih CNAME.

  6. Untuk 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) data. Anda dapat memverifikasi bahwa data DNS berfungsi dengan membuka nama domain dan mengonfirmasi bahwa domain tersebut me-resolve 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.

Mengosongkan

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 Anda buat.

  4. Klik Delete record sets.

  5. Buka halaman Cloud DNS zones.

    Buka Cloud DNS zones

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

Langkah berikutnya