title: How to add private DNS zone to kube-dns in GKE
body: <p>I have created a k8 cluster in GKE. </p>
  
  <p>I have a docker registry created in Artifactory, this artifactory is hosted on AWS. I have a route53 entry for <em>docker-repo.aws.abc.com</em> in <em>aws.abc.com</em> Hosted zone in AWS</p>
  
  <p>Now, I need to configure my cluster so that the docker images are pulled from artifactory. </p>
  
  <p>I went through documentation and understand I will have to add <em>stubDomain</em> in my <em>kube-dns</em> configmaps. </p>
  
  <pre><code>kubectl edit cm kube-dns -n kube-system
  apiVersion: v1
  data:
    stubDomains: |
      {"aws.abc.com" : ["XX.XX.XX.XX"]}
  kind: ConfigMap
  metadata:
    creationTimestamp: 2019-05-21T14:30:15Z
    labels:
      addonmanager.kubernetes.io/mode: EnsureExists
    name: kube-dns
    namespace: kube-system
    resourceVersion: "7669"
    selfLink: /api/v1/namespaces/kube-system/configmaps/kube-dns
    uid: f378aa5f-7bd4-11e9-9df2-42010aa93d03
  </code></pre>
  
  <p>However, still docker pull command fails. </p>
  
  <p><code>docker pull docker-repo.aws.abc.com/abc-sampleapp-java/abc-service:V-57bc9c9-201</code></p>
  
  <p><code>Error response from daemon: Get https://docker-repo.aws.abc.com/v2/: dial tcp: lookup docker-dev-repo.aws.abc.com on 169.254.169.254:53: no such host</code></p>
  
  <p>Note: When I make an entry in <em>/etc/hosts</em> file on worker nodes, docker pull works fine. </p>