doc/orphaned/dns_local_network.md

48 lines
2.3 KiB
Markdown
Raw Normal View History

2020-09-18 19:11:15 +02:00
# Local network access to your server
2015-05-20 22:57:07 +02:00
After completing your server installation, it is most likely that your domain will not be accessible through the local network. This is a know issue known as [hairpinning](http://en.wikipedia.org/wiki/Hairpinning).
To resolve this issue, you need to configure your router dns or, failing, your hosts files on your clients workstation
### Get the server local IP adress
In order to configure DNS or hosts file, you must know the private IP adress of your server. This adress is only working in the server local network and is not linked to your public IP adress.
You may retrieve your server private IP adress through different means:
2020-09-14 11:23:05 +02:00
- Using the YunoHost connection screen on the server:
<img src="/images/ynh_login.png" width=600>
2015-05-20 22:57:07 +02:00
2020-09-14 11:23:05 +02:00
- Using YunoHost administration panel:
Go to Tools > State of the server > Network
<img src="/images/ynh_admin_etat_ip.png" width=900>
2015-05-20 22:57:07 +02:00
- Or using your router or internet box, depending on model.
## Configure DNS of Internet box or router
2020-09-22 22:27:52 +02:00
The goal here is to create a network wide redirection handled by your router. The idea is to create a DNS redirection to your server's IP. You should access your router's configuration and look for DNS configuration, then add a redirection to your server's IP (e.g. redirect `yunohost.local` to `192.168.1.21`).
2015-05-20 22:57:07 +02:00
### SFR Box
If you haven't found your server private IP, you may find it using the SFR box admin panel:
Go to Network tab > General
<img src="/images/ip_serveur.png" width=800>
2015-05-20 22:57:07 +02:00
#### Configure SFR box's DNS
Go to Network tab > DNS and add your domain name to the box's DNS.
<img src="/images/dns_9box.png" width=800>
2015-05-20 22:57:07 +02:00
## Configure [hosts](https://en.wikipedia.org/wiki/Host_%28Unix%29) file on client workstation
Modifying hosts file should be done only if you cannot alter your box's DNS or router, because hosts file will only impact the workstation where the file was modified.
- Windows hosts file is located at:
`%SystemRoot%\system32\drivers\etc\`
> You MUST activate hidden and system file display to see the hosts file.
2020-09-22 22:27:52 +02:00
- UNIX systems (GNU/Linux, macOS) hosts file is located at:
2015-05-20 22:57:07 +02:00
`/etc/hosts`
> You MUST have root privileges to modify the file.
Add a line at the end of the file containing your server private IP followed by a space and your domain name
```bash
192.168.1.62 domain.tld
```