Skip to content

Instantly share code, notes, and snippets.

@praisegeek
Forked from eloypnd/dnsmasq_setup_osx.md
Created June 14, 2022 12:05
Show Gist options
  • Save praisegeek/b47b6d7cb9963d31c06cf2bb0eef159f to your computer and use it in GitHub Desktop.
Save praisegeek/b47b6d7cb9963d31c06cf2bb0eef159f to your computer and use it in GitHub Desktop.

Revisions

  1. Eloy Pineda revised this gist Jul 19, 2016. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion dnsmasq_setup_osx.md
    Original file line number Diff line number Diff line change
    @@ -19,7 +19,6 @@ $ sudo launchctl stop homebrew.mxcl.dnsmasq
    $ sudo launchctl start homebrew.mxcl.dnsmasq
    ```
    - For OS X to _resolve_ requests from `*.local` to **localhost** we need to add a _resolver_:
    (re-start the computer to enable the _resolver_)
    ```
    $ sudo mkdir /etc/resolver
    $ sudo touch /etc/resolver/local
    @@ -28,6 +27,7 @@ $ sudo touch /etc/resolver/local
    ```
    nameserver 127.0.0.1
    ```
    - re-start the computer to enable the _resolver_

    ===
    **REFERENCES**
  2. Eloy Pineda revised this gist Jul 19, 2016. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion dnsmasq_setup_osx.md
    Original file line number Diff line number Diff line change
    @@ -18,7 +18,7 @@ $ sudo brew services start dnsmasq
    $ sudo launchctl stop homebrew.mxcl.dnsmasq
    $ sudo launchctl start homebrew.mxcl.dnsmasq
    ```
    - For OS X to _resolve_ requests from `*.local` to **localhost** we need to add a _resolver_:
    - For OS X to _resolve_ requests from `*.local` to **localhost** we need to add a _resolver_:
    (re-start the computer to enable the _resolver_)
    ```
    $ sudo mkdir /etc/resolver
  3. Eloy Pineda revised this gist Jul 19, 2016. 1 changed file with 1 addition and 0 deletions.
    1 change: 1 addition & 0 deletions dnsmasq_setup_osx.md
    Original file line number Diff line number Diff line change
    @@ -19,6 +19,7 @@ $ sudo launchctl stop homebrew.mxcl.dnsmasq
    $ sudo launchctl start homebrew.mxcl.dnsmasq
    ```
    - For OS X to _resolve_ requests from `*.local` to **localhost** we need to add a _resolver_:
    (re-start the computer to enable the _resolver_)
    ```
    $ sudo mkdir /etc/resolver
    $ sudo touch /etc/resolver/local
  4. Eloy Pineda created this gist Jul 19, 2016.
    39 changes: 39 additions & 0 deletions dnsmasq_setup_osx.md
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,39 @@
    # wildcard DNS in localhost development
    - install [dnsmasq](http://www.thekelleys.org.uk/dnsmasq/doc.html)
    ```
    $ brew install dnsmasq
    ...
    $ cp /usr/local/opt/dnsmasq/dnsmasq.conf.example /usr/local/etc/dnsmasq.conf
    ```
    - edit `/usr/local/etc/dnsmasq.conf`
    ```
    address=/local/127.0.0.1
    ```
    - start **dnsmasq**
    ```
    $ sudo brew services start dnsmasq
    ```
    - any time we change `dnsmasq.conf` we have to re-start **dnsmasq**:
    ```
    $ sudo launchctl stop homebrew.mxcl.dnsmasq
    $ sudo launchctl start homebrew.mxcl.dnsmasq
    ```
    - For OS X to _resolve_ requests from `*.local` to **localhost** we need to add a _resolver_:
    ```
    $ sudo mkdir /etc/resolver
    $ sudo touch /etc/resolver/local
    ```
    - edit `/etc/resolver/local`
    ```
    nameserver 127.0.0.1
    ```

    ===
    **REFERENCES**

    - [Using Dnsmasq for local development on OS X - Passing Curiosity](https://passingcuriosity.com/2013/dnsmasq-dev-osx/)
    - [Using Dnsmasq Configure Wildcard DNS Record on Mac | Ri Xu Online](https://xuri.me/2014/12/13/using-dnsmasq-configure-wildcard-dns-record-on-mac.html)
    - [unix - In my /etc/hosts/ file on Linux/OSX, how do I do a wildcard subdomain? - Server Fault](http://serverfault.com/questions/118378/in-my-etc-hosts-file-on-linux-osx-how-do-i-do-a-wildcard-subdomain)
    - [hostname - Wildcard in /etc/hosts file - Unix & Linux Stack Exchange](http://unix.stackexchange.com/questions/3352/wildcard-in-etc-hosts-file)
    - [Mac OS Lion - Wildcard subdomain virtual host - Stack Overflow](http://stackoverflow.com/questions/9562059/mac-os-lion-wildcard-subdomain-virtual-host)
    - [How to put wildcard entry into /etc/hosts? - Stack Overflow](http://stackoverflow.com/questions/20446930/how-to-put-wildcard-entry-into-etc-hosts)