# Local DNS

## 1. Create a new hosts file

```bash
sudo nano /etc/hosts.mydomain
```

Add IP addresses followed by the local hostname you'd like to resolve, one per line. \
\
Write out and exit.

## 2. Create a new dnsmasq conf file

```bash
sudo nano /etc/dnsmasq.d/02-mydns.conf
```

## 3. Add addn-hosts Line

Reference hosts file created in step one

```bash
addn-hosts=/etc/hosts.mydomain
```

Write out and exit

## 4. Restart dnsmasq

```bash
sudo service dnsmasq restart
```


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://strangebutohwell.gitbook.io/knowledge/applications/pihole/local-dns.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
