<commit_before># How do I run my own DNSChain Server?

- [Requirements](#requirements)
- [Getting Started](#getting-started)
- [Configuration](#configuration)
- [Guide: Setting up DNSChain + Namecoin + PowerDNS](#guide-setting-up-dnschain--namecoin--powerdns)

Get yourself a Linux server (they come as cheap as $2/month), and then make sure you have the following software installed:

## Requirements

1. `nodejs` (or `iojs`), and `npm` - We recommend using a package manager to install them, e.g.,
    
    $ sudo apt-get update
    $ sudo apt-get install npm

2. [coffee-script](https://github.com/jashkenas/coffee-script) (version 1.7.1+) - install via `npm install -g coffee-script`
3. A supported blockchain daemon like `namecoind`

## Getting Started

1. Install DNSChain using: `npm install -g dnschain` (you may need to put `sudo` in front of that).
2. Run `namecoind` in the background. You can use `systemd` and create a `namecoin.service` file for it based off of [dnschain.service](<../scripts/dnschain.service>).
3. If an update is released, update your copy using: `npm update -g dnschain`

##### Verify it runs

Test DNSChain by simply running `dnschain` from the command line (developers [see here](#Working)). Have a look at the configuration section below, and when you're ready, run it in the background as a daemon. As a convenience, DNSChain [comes with a `systemd` unit file](<../scripts/dnschain.service>) that you can use to run it.

By default, it will start listening for DNS requests on port `53` if you run it as `root`, and `5333` otherwise. You can test `.bit` resolution with `dig`:

    $ dig @localhost -p 5333 okturtles.bit

**:page_facing_up: [Guide to Setting Up DNSChain + Namecoin + PowerDNS on Debian Wheezy](setting-up-dnschain-namecoin-powerdns-server.md)**

<a name="autogen"></a>
##### Verify the SSL/TLS key and certificate fingerprint

By default, DNSChain will automatically use the `openssl` command to generate a random public/private keypair for you.

By default, it will place the private key in `~/.dnschain/key.pem` and `~/.dnschain/cert.pem`, and it will `chmod 600` the private key (making it unreadable by other user accounts on the machine). You should verify the permissions are correct yourself.

If you want, you can generate the key and certificate yourself using a command similar to this:

    openssl req -new -newkey rsa:4096 -days 730 -nodes -sha256 -x509 \
                -subj "/C=US/ST=Florida/L=Miami/O=Company/CN=www.example.com" \
                -keyout key.pem \<commit_msg>Update How-do-I-run-my-own.md<commit_after># How do I run my own DNSChain Server?

- [Requirements](#requirements)
- [Getting Started](#getting-started)
- [Configuration](#configuration)
- [Guide: Setting up DNSChain + Namecoin + PowerDNS](#guide-setting-up-dnschain--namecoin--powerdns)

Get yourself a Linux server (they come as cheap as $2/month), and then make sure you have the following software installed:

## Requirements

1. `nodejs` (or `iojs`), and `npm` - We recommend using a package manager to install them
2. [coffee-script](https://github.com/jashkenas/coffee-script) (version 1.7.1+) - install via `npm install -g coffee-script`
3. A supported blockchain daemon like `namecoind`

## Getting Started

1. Install DNSChain using: `npm install -g dnschain` (you may need to put `sudo` in front of that).
2. Run `namecoind` in the background. You can use `systemd` and create a `namecoin.service` file for it based off of [dnschain.service](<../scripts/dnschain.service>).
3. If an update is released, update your copy using: `npm update -g dnschain`

##### Verify it runs

Test DNSChain by simply running `dnschain` from the command line (developers [see here](#Working)). Have a look at the configuration section below, and when you're ready, run it in the background as a daemon. As a convenience, DNSChain [comes with a `systemd` unit file](<../scripts/dnschain.service>) that you can use to run it.

By default, it will start listening for DNS requests on port `53` if you run it as `root`, and `5333` otherwise. You can test `.bit` resolution with `dig`:

    $ dig @localhost -p 5333 okturtles.bit

**:page_facing_up: [Guide to Setting Up DNSChain + Namecoin + PowerDNS on Debian Wheezy](setting-up-dnschain-namecoin-powerdns-server.md)**

<a name="autogen"></a>
##### Verify the SSL/TLS key and certificate fingerprint

By default, DNSChain will automatically use the `openssl` command to generate a random public/private keypair for you.

By default, it will place the private key in `~/.dnschain/key.pem` and `~/.dnschain/cert.pem`, and it will `chmod 600` the private key (making it unreadable by other user accounts on the machine). You should verify the permissions are correct yourself.

If you want, you can generate the key and certificate yourself using a command similar to this:

    openssl req -new -newkey rsa:4096 -days 730 -nodes -sha256 -x509 \
                -subj "/C=US/ST=Florida/L=Miami/O=Company/CN=www.example.com" \
                -keyout key.pem \
{'fraction_non_alphanumeric': 0.10824742268041238, 'fraction_numerical': 0.014274385408406027, 'mean_word_length': 3.9851778656126484, 'pattern_counts': {'":': 0, '<': 11, '<?xml version=': 0, '>': 11, 'https://': 2, 'lorem ipsum': 0, 'www.': 2, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2199210', 'n_tokens_mistral': 1628, 'n_tokens_neox': 1491, 'n_words': 649}