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

ERL-1383: Trouble configuring inet_db nameserver #4352

Open
OTP-Maintainer opened this issue Oct 15, 2020 · 0 comments
Open

ERL-1383: Trouble configuring inet_db nameserver #4352

OTP-Maintainer opened this issue Oct 15, 2020 · 0 comments
Assignees
Labels
bug Issue is reported as a bug priority:low stalled waiting for input by the Erlang/OTP team team:PS Assigned to OTP team PS

Comments

@OTP-Maintainer
Copy link

Original reporter: JIRAUSER16901
Affected version: Not Specified
Component: Not Specified
Migrated from: https://bugs.erlang.org/browse/ERL-1383


* OTP version
 ** Erlang/OTP 24 [DEVELOPMENT] [erts-11.1.1] [source-820b2f696d] and Erlang/OTP 23 [erts-11.1.1]
 * Configure flags when building (e.g. ./configure --enable-halfword-emulator --enable-shared-zlib)
 ** KERL_CONFIGURE_OPTIONS="--disable-debug --disable-silent-rules --without-javac --enable-shared-zlib --enable-sctp --enable-smp-support --enable-threads --enable-kernel-poll --enable-wx --enable-darwin-64bit --with-ssl=/usr/local/opt/openssl@1.1"
 * Operating system/distribution
 ** MacOS 10.15.6

There appears to be a bug, which causes the order of configuration options in an erl_inetrc configuration file to be significant. I noticed this behaviour specifically with the `resolv_conf` and `nameserver` options, as described [here|[http://erlang.org/doc/apps/erts/inet_cfg.html].]For example, consider the following erl_inetrc file: 

 $ cat erl_inetrc
{nameserver, {1,1,1,1}}.

{resolv_conf, “”}.
 ```
 results in the following configuration:

 $ erl -kernel inetrc ‘“./erl_inetrc”’
Erlang/OTP 24 [DEVELOPMENT] [erts-11.1.1] [source-820b2f696d] [64-bit] [smp:16:16] [ds:16:16:10] [async-threads:1] [jit]
Eshell V11.1.1 (abort with ^G)
1> inet:get_rc().
[\{domain,“local”},
 \{resolv_conf,[]},
 \{hosts_file,“/etc/hosts”},
 {lookup,[native]}]
 ```

However, if I switch the order of the nameserver & resolv_conf configuration, then it does load the nameserver as expected:```
$ cat erl_inetrc
\{resolv_conf, “”}.
\{nameserver, {1,1,1,1}}.
 $ erl -kernel inetrc ‘“./erl_inetrc”’
 Erlang/OTP 24 [DEVELOPMENT] [erts-11.1.1] [source-820b2f696d] [64-bit] [smp:16:16] [ds:16:16:10] [async-threads:1] [jit]
 Eshell V11.1.1 (abort with ^G)
 1> inet:get_rc().
 [\{domain,“local”},
  \{nameservers,{1,1,1,1}},
  \{resolv_conf,[]},
  \{hosts_file,“/etc/hosts”},
  {lookup,[native]}]

Just to be sure, I tried on the latest 23.1.1 release and confirmed the behaviour is the same there.

I have not noticed this issue with other configuration options, for example alt_nameserver works if it comes before or after the resolv_conf config.

Please excuse my formatting, I am fighting with this version of Jira...

@OTP-Maintainer OTP-Maintainer added bug Issue is reported as a bug team:PS Assigned to OTP team PS priority:low labels Feb 10, 2021
jchristgit added a commit to jchristgit/otp that referenced this issue May 5, 2023
Previously, when parsing a resolv.conf file from the Inet configuration
option `{resolv_conf, File}` it would unconditionally remove any
nameservers previously added to the configuration file. With this
change, the existing nameservers are only replaced from resolv.conf when
resolv.conf actually had nameservers specified.

The existing behaviour of these two depending on order (due to the
nameserver option using the add op and the nameservers in resolv.conf
using the replace op) has been documented and a test case added.

Fixes erlang#4352.
jchristgit added a commit to jchristgit/otp that referenced this issue May 5, 2023
Previously, when parsing a resolv.conf file from the Inet configuration
option `{resolv_conf, File}` it would unconditionally remove any
nameservers previously added to the configuration file. With this
change, the existing nameservers are only replaced from resolv.conf when
resolv.conf actually had nameservers specified.

The existing behaviour of these two depending on order (due to the
nameserver option using the add op and the nameservers in resolv.conf
using the replace op) has been documented and a test case added.

Fixes erlang#4352.
jchristgit added a commit to jchristgit/otp that referenced this issue May 6, 2023
Previously, when parsing a resolv.conf file from the Inet configuration
option `{resolv_conf, File}` it would unconditionally remove any
nameservers previously added to the configuration file. With this
change, the existing nameservers are only replaced from resolv.conf when
resolv.conf actually had nameservers specified.

The existing behaviour of these two depending on order (due to the
nameserver option using the add op and the nameservers in resolv.conf
using the replace op) has been documented and a test case added.

Fixes erlang#4352.
@IngelaAndin IngelaAndin added the stalled waiting for input by the Erlang/OTP team label Dec 5, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Issue is reported as a bug priority:low stalled waiting for input by the Erlang/OTP team team:PS Assigned to OTP team PS
Projects
None yet
Development

No branches or pull requests

3 participants