Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Change default domain from .dev to .puma since Google took .dev into the forbidden lands of HSTS #3

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ Simple top level domain (NSSwitch hosts) resolver for linux based development en

# Supported Linux Distributions

This tool is developed in a Ubuntu 12.04 system & tested in later vesrions of Ubuntu & Ubuntu derivatives. Even though not tested, it should also work in other Linux distributions that supports/uses [nsswitch.conf](http://man7.org/linux/man-pages/man5/nsswitch.conf.5.html) file based configuration. In general, if your Linux installation has a file named **nsswitch.conf** in **/etc/** folder, then you should be ready to go with using this tool.
This tool is developed in a Ubuntu 12.04 system & tested in later versions of Ubuntu & Ubuntu derivatives. Even though not tested, it should also work in other Linux distributions that supports/uses [nsswitch.conf](http://man7.org/linux/man-pages/man5/nsswitch.conf.5.html) file based configuration. In general, if your Linux installation has a file named **nsswitch.conf** in **/etc/** folder, then you should be ready to go with using this tool.

# Installation

Expand All @@ -26,14 +26,14 @@ sudo make install

> It's very important that you run the ```make install``` command as **root** or using **sudo**, otherwise installation will fail.

- As root (or in super user mode with sudo) also edit **/etc/environment** using a text editor of your choice and export a global environment variable named **DEV_TLD_DOMAINS** with comma separated list of Top Level Domains (**tld**) that you want to resolve to ```127.0.0.1``` automatically. For example, if you want ```.dev```, ```.wp```, ```.dpl``` top level domains to be resolved by **dev-tld-resolver**, your **/etc/environment** should have following line within it somewhere.
- As root (or in super user mode with sudo) also edit **/etc/environment** using a text editor of your choice and export a global environment variable named **DEV_TLD_DOMAINS** with comma separated list of Top Level Domains (**tld**) that you want to resolve to ```127.0.0.1``` automatically. For example, if you want ```.puma```, ~~```.dev```~~, ```.wp```, ```.dpl``` top level domains to be resolved by **dev-tld-resolver**, your **/etc/environment** should have following line within it somewhere.
```
DEV_TLD_DOMAINS=dev,wp,dpl
DEV_TLD_DOMAINS=puma,wp,dpl
```

> Above step is optional if you don't need **dev-tld-resolver** to resolve top level domains other than ```.dev```, which is the default
> Above step is optional if you don't need **dev-tld-resolver** to resolve top level domains other than ```.puma```, which is the default

- Lastly as root (or in super user mode with sudo) edit ```/etc/nsswitch.conf``` file and append ```dev_tld``` to the line starting with ```hosts:```.
- Lastly as root (or in super user mode with sudo) edit ```/etc/nsswitch.conf``` file and append ```dev_tld``` to the line starting with ```hosts:```.

> If you have following line starting with ```hosts:``` in ```/etc/nsswitch.conf``` file
> ```
Expand All @@ -50,7 +50,7 @@ DEV_TLD_DOMAINS=dev,wp,dpl

- Now logout or reboot your system and login again. After logging in into the system, open a command line and type following command
```
ping test.dev
ping test.puma
```
If ping is successful, then **dev-tld-resolver** is installed & configured correctly.

Expand Down
2 changes: 1 addition & 1 deletion src/nss_dev_tld.c
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ _nss_dev_tld_gethostbyname2_r(const char *name,
char *env = getenv("DEV_TLD_DOMAINS");
char *domains;
if (env == NULL) {
domains = strdup("dev");
domains = strdup("puma");
} else {
domains = strdup(env);
}
Expand Down