mirror of
https://github.com/cytopia/devilbox.git
synced 2025-01-18 10:46:23 +00:00
REL-0.11 Auto-DNS documentation
This commit is contained in:
parent
0430331123
commit
f965f7ea44
@ -659,6 +659,67 @@ If you also want to change the listening address (default: 127.0.0.1) to somethi
|
||||
|
||||
#### 6.1 /etc/hosts
|
||||
|
||||
In the `/etc/hosts` file you will have to configure your project DNS.
|
||||
|
||||
Each project is available in your browser via `http://<project-folder>.<TLD_SUFFIX>`. However your Host computer is not aware of this DNS name by default. In order to tell it to what IP address the domain should be resolved, you will need to make one entry per project in the `/etc/hosts` file on your host computer.
|
||||
|
||||
These entries typically look like this:
|
||||
|
||||
```shell
|
||||
$ cat /etc/hosts
|
||||
|
||||
127.0.0.1 localhost
|
||||
```
|
||||
|
||||
If you have set `TLD_SUFFIX` to `loc` and your project folder is named `my-project`, you will need to add the following entry:
|
||||
```
|
||||
127.0.0.1 my-project.loc
|
||||
```
|
||||
|
||||
As you can see, the following general structure for all project applies:
|
||||
```
|
||||
<LOCAL_LISTEN_ADDRESS> <project-folder>.<TLD_SUFFIX>
|
||||
```
|
||||
|
||||
See **Project settings** for more detail.
|
||||
|
||||
|
||||
**Note:** On Windows the file can be found under: `C:\Windows\System32\drivers\etc`
|
||||
|
||||
|
||||
If you do not want to create this entry everytime for a new project, skip to the next section to see how to setup Auto-DNS.
|
||||
|
||||
#### 6.2 Auto-DNS
|
||||
|
||||
The devilbox provides its own DNS nameserver that automatically configures itself based on the values of `TLD_SUFFIX`. That means each `<project-folder>.<TLD_SUFFIX>` domain will always point to `127.0.0.1`.
|
||||
|
||||
You can make advantage of that by adding this DNS nameserver to your host computers DNS config in `/etc/resolv.conf`. Then everytime you make a request (in your Browser for example) to a devilbox project domain, the bundled DNS name server will successfully answer the request and direct you to the project. This will remove the need to make custom `/etc/hosts` entries for each project.
|
||||
|
||||
**What is required for this to work?**
|
||||
|
||||
First of all, you need to make sure that nothing on your host computer is listening on port 53.
|
||||
|
||||
```shell
|
||||
$ netstat -tulpen | grep ':53'
|
||||
```
|
||||
|
||||
If there is already something listening on that port, you will need to stop whatever is listening in port 53 (TCP and UDP).
|
||||
|
||||
If nothing is listening anymore on port 53, edit your `/etc/resolv.conf` and add the following line above all other `nameserver` entries:
|
||||
|
||||
```
|
||||
nameserver 127.0.0.1
|
||||
```
|
||||
|
||||
**Note:** Keep all other `nameserver` entries intact. The devilbox DNS nameserver will only work once the devilbox is running. If you remove all others and don't run the devilbox, you won't be able to resolve any DNS names anymore.
|
||||
|
||||
Afterwards `/etc/resolv.conf` will look similar to this:
|
||||
```
|
||||
# Dynamic resolv.conf(5) file for glibc resolver(3) generated by resolvconf(8)
|
||||
# DO NOT EDIT THIS FILE BY HAND -- YOUR CHANGES WILL BE OVERWRITTEN
|
||||
nameserver 127.0.0.1
|
||||
nameserver 192.168.0.10
|
||||
search local
|
||||
```
|
||||
|
||||
**Note:** This section needs to be improved with more detail. If anything is unclear for now, drop an issue at Github.
|
||||
|
Loading…
Reference in New Issue
Block a user