Netskope LogoNetskope Logo
  • Security Services
  • AI Services
  • Networking Services
  • Analytics Services
  • Integrations
  • getting-started.svgGetting Started
    • Support
    • Community
    • Netskope.com
    © 2026 All Rights Reserved. Netskope Inc.
    Home
    Netskope Private Access
    Publisher Management
    Deploy a Publisher
    Create a New Publisher
    Manually Configure Custom DNS on GCP

    Manually Configure Custom DNS on GCP

    This section provides optional steps for users who need to bypass the native Google Cloud Platform DNS service and use their own external or self-hosted DNS resolvers instead.

    This configuration is often required for software like the Netskope Publisher, which must connect to an organization’s private DNS servers to resolve internal application domains.

    About the gce-resolved.conf File

    Recent versions of the Google Compute Engine package include a file at /etc/systemd/resolved.conf.d/gce-resolved.conf. GCP added this file to ensure that lookups for internal .local Cloud DNS domains are correctly routed to the GCP metadata server (169.254.169.254).

    A side effect of this file is that it can route all DNS traffic to the metadata server, which may conflict with the need to use an external DNS service. If your environment doesn’t rely on GCP’s .local domain resolution, you can safely remove this file to resolve the conflict.

    The following steps explain how to do this.

    Configuration Steps

    You’ll need sudo or root privileges to perform these commands.

    Remove the GCP DNS Configuration File

    To disable the override, you must remove the auto-generated configuration file.

    sudo rm /etc/systemd/resolved.conf.d/gce-resolved.conf

    Set your Custom DNS Servers

    Add the netplan config to specify your DNS servers.

    1. Open the file with a text editor like nano:
      sudo vi /etc/netplan/80-custom-dns.yaml
    2. The following is an example of using 8.8.8.8 and 1.1.1.1 as your DNS server, and using domain.com as the search domain:
      network:
       version: 2
       renderer: networkd
       ethernets:
        ens4:
         dhcp4: true
         dhcp4-overrides:
          use-dns: false
         dhcp6: true
         dhcp6-overrides:
          use-dns: false
         nameservers:
          addresses:
           - 8.8.8.8
           - 1.1.1.1
          search:
           - domain.com
    3. Save the file and exit the editor.
    4. Set appropriate file permissions.
      sudo chmod 600 /etc/netplan/80-custom-dns.yaml
    5. Test the changes:
      sudo netplan try
      
    6. Apply the changes.
      sudo netplan apply

    Restart the Resolver Service

    sudo systemctl restart systemd-resolved

    Validation

    Run resolvectl status again. Confirm that the DNS Servers line now shows your custom server IPs and that $169.254.169.254$ is no longer listed.

    Your should be able to see your custom DNS servers and search domain in /etc/resolv.conf .

    (Optional) Fix Hostname Resolution Issues

    If you see an error like Unable to resolve host ubuntu-22: Name or service not known, add your hostname entry to /etc/hosts. 

    127.0.0.1 ubuntu-22
    In this Topic
    • Manually Configure Custom DNS on GCP