Home

Awesome

dev-tld-resolver

Simple top level domain (NSSwitch hosts) resolver for linux based development environment.

Supported Linux Distributions

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 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

Ubuntu

sudo apt-get install build-essentials git
git clone https://github.com/mnishihan/dev-tld-resolver.git
cd dev-tld-resolver/src && make
sudo make install

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

DEV_TLD_DOMAINS=dev,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

If you have following line starting with hosts: in /etc/nsswitch.conf file

hosts: files mdns4_minimal [NOTFOUND=return] dns mdns4

then you should change it to look like

hosts: files mdns4_minimal [NOTFOUND=return] dns mdns4 dev_tld

If you experience some sort of delay while resolving a host name, you should try to move dev_tld before dns, as follows

hosts: files mdns4_minimal [NOTFOUND=return] dev_tld dns mdns4
ping test.dev

If ping is successful, then dev-tld-resolver is installed & configured correctly.

Credits

Code is borrowed & modified from prax by ysbaddaden at https://github.com/ysbaddaden/prax