You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Note, I'm using Elixir, so I might mess up some of the syntax. My apologies in advance!
Describe the bug
On localhost, dns lookups were slow (700ms). This was after setting the ns to 1.1.1.1. When I looked up a DNS entry with inet_res.lookup, and then looked at the resolved ns, they were different than before I ran. I'm not sure where these name servers are coming from, but they're very slow (I'm assuming from my internet provider). Regardless, when I set the NS for inet, they should not be erased when using inet_res.lookup
The resolv_conf option set to "/etc/resolv.conf" means that that file will be monitored, and when it changes, (inet_res checks the file time stamp before every query) the content is read and the nameservers and search options are be updated from the file content.
You may add more name servers using inet_db:add_alt_ns/1,2 that are not auto updated, but that doesn't get rid of any slow nameservers in the primary list, which are tried first.
You can disable this auto update function by setting the resolv_conf file name to "" with inet_db:set_resolv_conf(""), and then you will have to set and update the name servers and search domain at your own discretion.
Note, I'm using Elixir, so I might mess up some of the syntax. My apologies in advance!
Describe the bug
On localhost, dns lookups were slow (700ms). This was after setting the ns to 1.1.1.1. When I looked up a DNS entry with inet_res.lookup, and then looked at the resolved ns, they were different than before I ran. I'm not sure where these name servers are coming from, but they're very slow (I'm assuming from my internet provider). Regardless, when I set the NS for inet, they should not be erased when using inet_res.lookup
To Reproduce
`:ets.tab2list(:inet_db)`
"elixir-lang.org" |> String.to_charlist() |> :inet_res.lookup(:in, :mx, [], 1000)
`:ets.tab2list(:inet_db)`
To fix this, the db can be reset and the NS added again:
:inet_db.reset()
:inet_db.add_ns({1,1,1,1})
"elixir-lang.org" |> String.to_charlist() |> :inet_res.lookup(:in, :mx, [], 1000)
:ets.tab2list(:inet_db)
Resolved NS are still 1.1.1.1
Expected behavior
When I set the nameservers for inet, they should not be erased when using inet_res.lookup
Affected versions
This is affecting Elixir 1.17 running on Erlang 25.3.2.16.
The text was updated successfully, but these errors were encountered: