<commit_before>This is a little tool that I needed so that I could point my laptop at an AWS
region running Elastic Load Balancing that was not yet in production, but
refer to that region by the public HTTPS domain name that it would eventually
be serving.

## Installing:

* `git clone git://github.com/jrgm/dnshook.git`

* `cd dnshook`

* Copy `config.json-dist` to `config.json` and edit that file to map the
  public domain name(s) to one (or more) ELB domain names.

* `npm install`

## Running:

* `./dnshook.js --help`:

```
    Remap DNS requests for some.host.tld to use a specific ELB in an AWS region
    
    Usage: node ./dnshook.js [options]
    
    Options:
      --help           display this usage message                                   
      --real-resolver  what resolver to use for domains we are not intercepting, or
                       for when we need to get the real answer  [default: "8.8.8.8"]
      --port           what port to bind                               [default: 53]
      --config-file    path/to/config.json                [default: "./config.json"]
      --logfile        path/to/logging.log                [default: "./logging.log"]
```

* change your DNS configuration to use 127.0.0.1 as the resolver. (See notes
  below on how to change this from the OSX command line).

* `sudo ./dnshook [options]`. Usually the defaults are what you need.

* Logging will go both to the console, and to the `--logfile`

## How to change the OSX resolver address from the command line:

### List the available interfaces (you probably want the wireless one):

    $ networksetup listallnetworkservices
      Ethernet
      Wi-Fi
      iPhone USB

### List your current dns server(s).
    
    $ sudo networksetup -getdnsservers Wi-Fi
    
### Set it to where you want, e.g.:

    $ sudo networksetup -setdnsservers Wi-Fi 127.0.0.1

### Set it back to default:

    $ sudo networksetup -setdnsservers Wi-Fi <your original resolver list>

    $ sudo networksetup -setdnsservers Wi-Fi empty

    Note: type the above line exactly (i.e., 'empty' doesn't mean '')


## Caveats:<commit_msg>fix missing '-' on listallnetworkservices<commit_after>This is a little tool that I needed so that I could point my laptop at an AWS
region running Elastic Load Balancing that was not yet in production, but
refer to that region by the public HTTPS domain name that it would eventually
be serving.

## Installing:

* `git clone git://github.com/jrgm/dnshook.git`

* `cd dnshook`

* Copy `config.json-dist` to `config.json` and edit that file to map the
  public domain name(s) to one (or more) ELB domain names.

* `npm install`

## Running:

* `./dnshook.js --help`:

```
    Remap DNS requests for some.host.tld to use a specific ELB in an AWS region
    
    Usage: node ./dnshook.js [options]
    
    Options:
      --help           display this usage message                                   
      --real-resolver  what resolver to use for domains we are not intercepting, or
                       for when we need to get the real answer  [default: "8.8.8.8"]
      --port           what port to bind                               [default: 53]
      --config-file    path/to/config.json                [default: "./config.json"]
      --logfile        path/to/logging.log                [default: "./logging.log"]
```

* change your DNS configuration to use 127.0.0.1 as the resolver. (See notes
  below on how to change this from the OSX command line).

* `sudo ./dnshook [options]`. Usually the defaults are what you need.

* Logging will go both to the console, and to the `--logfile`

## How to change the OSX resolver address from the command line:

### List the available interfaces (you probably want the wireless one):

    $ networksetup -listallnetworkservices
      Ethernet
      Wi-Fi
      iPhone USB

### List your current dns server(s).
    
    $ sudo networksetup -getdnsservers Wi-Fi
    
### Set it to where you want, e.g.:

    $ sudo networksetup -setdnsservers Wi-Fi 127.0.0.1

### Set it back to default:

    $ sudo networksetup -setdnsservers Wi-Fi <your original resolver list>

    $ sudo networksetup -setdnsservers Wi-Fi empty

    Note: type the above line exactly (i.e., 'empty' doesn't mean '')


## Caveats:
{'fraction_non_alphanumeric': 0.09084523530789042, 'fraction_numerical': 0.00842893935846406, 'mean_word_length': 2.3193473193473193, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 6, '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': '2158889', 'n_tokens_mistral': 1292, 'n_tokens_neox': 1251, 'n_words': 524}