[Yandex Cloud documentation](../../../index.md) > [Yandex Managed Service for Kubernetes](../../index.md) > [Step-by-step guides](../index.md) > Installing applications from Cloud Marketplace > Installing NodeLocal DNS

# Installing NodeLocal DNS

[NodeLocal DNS](https://yandex.cloud/en/marketplace/products/yc/node-local-dns) reduces the load from DNS queries by running a caching agent on every [node](../../concepts/index.md#node-group) in a [Managed Service for Kubernetes cluster](../../concepts/index.md#kubernetes-cluster). This improves the Managed Service for Kubernetes cluster performance and fault tolerance.

## Getting started {#before-you-begin}

[Make sure](../connect/security-groups.md) the security groups for the Managed Service for Kubernetes cluster and its node groups are configured correctly. If a rule is missing, [add it](../../../vpc/operations/security-group-add-rule.md).

{% note warning %}

The configuration of security groups determines performance and availability of the cluster and the services and applications running in it.

{% endnote %}

## Installation from Yandex Cloud Marketplace {#marketplace-install}

1. In the [management console](https://console.yandex.cloud), select a folder.
1. Navigate to **Managed Service for&nbsp;Kubernetes**.
1. Click the name of the Managed Service for Kubernetes cluster you need and select the ![Marketplace](../../../_assets/console-icons/shopping-cart.svg) **Marketplace** tab.
1. Under **Application available for installation**, select [NodeLocal DNS](https://yandex.cloud/en/marketplace/products/yc/node-local-dns) and click **Go to install**.
1. Configure the application:
   * **Namespace**: Select the `kube-system` [namespace](../../concepts/index.md#namespace).

      {% note warning %}
      
      The application works correctly only with the `kube-system` namespace.
      
      {% endnote %}

   * **Application name**: Specify the name for the application to deploy in the Managed Service for Kubernetes cluster.
   * **Internal IP address of the kube-dns service**: Address for accessing NodeLocal DNSCache. Queries from application pods to the address in the field are translated to [local DNS](https://github.com/kubernetes/enhancements/blob/master/keps/sig-network/1024-nodelocal-cache-dns/README.md#iptables-notrack) via `iptables` rules.

      The field contains the `ClusterIP` address of `kube-dns` in the `kube-system` namespace. You can get the value of the field using this command:

      ```bash
      kubectl get svc kube-dns -n kube-system -o jsonpath={.spec.clusterIP}
      ```

      Since Yandex Cloud adds `kube-dns` when creating a cluster, its IP address is pre-defined. Therefore, you cannot change it in the **kube-dns internal IP address** field.

   * **Work with Cilium**: Select this option if a cluster uses the [Cilium network policy controller](../../concepts/network-policy.md#cilium).
1. Click **Install**.
1. Wait for the application to change its status to `Deployed`.

Once installed, NodeLocal DNS uses the following values:
* Managed Service for Kubernetes cluster zone: `cluster.local`
* NodeLocal DNS cache address: `169.254.20.10`
* Application port for external queries: `53`
* Port for collecting metrics in Prometheus format: `9253`

## Installation using a Helm chart {#helm-install}

1. [Install Helm](https://helm.sh/docs/intro/install/) v3.8.0 or higher.
1. [Install kubect](https://kubernetes.io/docs/tasks/tools/install-kubectl) and [configure it to work with the new cluster](../connect/index.md#kubectl-connect).
1. Get an address to access NodeLocal DNS Cache. You will need this address to install the [Helm chart](https://helm.sh/docs/topics/charts/):

   ```bash
   kubectl get svc kube-dns -n kube-system -o jsonpath={.spec.clusterIP}
   ```

   The command contains the `ClusterIP` address of `kube-dns` in the `kube-system` namespace. `kube-dns` is installed automatically when creating a cluster, so its IP address is pre-defined.

   Queries from application pods to this address are translated to [local DNS](https://github.com/kubernetes/enhancements/blob/master/keps/sig-network/1024-nodelocal-cache-dns/README.md#iptables-notrack) via `iptables` rules.

1. To install a Helm chart with NodeLocal DNS, run this command:

   ```bash
   helm pull oci://cr.yandex/yc-marketplace/yandex-cloud/node-local-dns \
     --version 1.5.1 \
     --untar && \
   helm install \
     --set config.cilium=false \
     --set config.clusterIp="<kube-dns_IP_address>" \
     --namespace kube-system \
     node-local-dns ./node-local-dns/
   ```

   {% note warning %}
   
   The application works correctly only with the `kube-system` namespace.
   
   {% endnote %}

   {% note info %}
   
   If you are using a Helm version below 3.8.0, add the `export HELM_EXPERIMENTAL_OCI=1 && \` string at the beginning of the command to enable [Open Container Initiative](https://opencontainers.org/) (OCI) support in the Helm client.
   
   {% endnote %}

Learn more about setting up local DNS caching in [Setting up NodeLocal DNS](../../tutorials/node-local-dns.md).