Page MenuHomeVyOS Platform

dns forwarding - When "ignore-hosts-file" is unset, local hostname of router resolves to 127.0.1.1
Closed, ResolvedPublicBUG

Description

Imagine the following DNS forwarding configuration:

set service dns forwarding allow-from '172.16.0.0/12'
set service dns forwarding listen-address '172.16.254.30'
set service dns forwarding listen-address '172.31.0.254'
set service dns forwarding negative-ttl '60'
set system domain-name 'mybll.net'
set system host-name 'BR1.wue3'

Clients using VyOS as their DNS server and trying to resolve BR1.wue3.mybll.net will receive 127.0.1.1 as answer.

We should not render our FQDN to the /etc/hosts file

### Autogenerated by VyOS ###
### Do not edit, your changes will get overwritten ###

# Local host
127.0.0.1       localhost
127.0.1.1       BR1.wue3.mybll.net BR1.wue3
# The following lines are desirable for IPv6 capable hosts
::1             localhost ip6-localhost ip6-loopback
fe00::0         ip6-localnet
ff00::0         ip6-mcastprefix
ff02::1         ip6-allnodes
ff02::2         ip6-allrouters

Details

Difficulty level
Easy (less than an hour)
Version
1.3.0
Why the issue appeared?
Design mistake
Is it a breaking change?
Behavior change
Issue type
Bug (incorrect behavior)

Event Timeline

We should keep this behavior in 1.3.7 but change it for 1.4 and onwards

c-po changed Difficulty level from Unknown (require assessment) to Easy (less than an hour).
c-po changed Why the issue appeared? from Will be filled on close to Design mistake.
c-po changed Is it a breaking change? from Unspecified (possibly destroys the router) to Behavior change.
c-po changed Issue type from Unspecified (please specify) to Bug (incorrect behavior).
c-po moved this task from Need Triage to 1.4.0-epa1 on the VyOS 1.4 Sagitta board.
c-po edited projects, added VyOS 1.4 Sagitta (1.4.0-epa1); removed VyOS 1.4 Sagitta.
c-po moved this task from Need Triage to Finished on the VyOS 1.4 Sagitta (1.4.0-epa1) board.
c-po moved this task from Need Triage to Finished on the VyOS 1.5 Circinus board.

That commit has the side effect that using sudo or even just committing some configurations will return "sudo: unable to resolve host vyos: System error" every time. Applications that rely on the system hostname will also not be able to reach localhost if the hostname is not a FQDN.

I don't see why that should be the case instead of just using "set service dns forwarding ignore-hosts-file".

Maybe we could just add "127.0.1.1 {{ host_name }}" to /etc/hosts and leave de domain name out?