aboutsummaryrefslogtreecommitdiffstats
path: root/lib/kernel/src/inet_config.erl
diff options
context:
space:
mode:
authorErlang/OTP <[email protected]>2010-02-10 09:06:48 +0000
committerErlang/OTP <[email protected]>2010-02-10 09:06:48 +0000
commita32352f3e450dcf13ff6a191ae73327f5f93d41b (patch)
tree316c540de45a970d8bf9336f8130ab654274d402 /lib/kernel/src/inet_config.erl
parent19fda3d8ddbd8b844024bd15689dbf45fa8e5e1e (diff)
parent7dbd225787b498f4815d407ff889ff8630dabdbd (diff)
downloadotp-a32352f3e450dcf13ff6a191ae73327f5f93d41b.tar.gz
otp-a32352f3e450dcf13ff6a191ae73327f5f93d41b.tar.bz2
otp-a32352f3e450dcf13ff6a191ae73327f5f93d41b.zip
Merge branch 'rani/inet_gethostbyname_fixes' into ccase/r13b04_dev
* rani/inet_gethostbyname_fixes: inet_res_SUITE: testcase fixes for legacy DNS resolver (Solaris 8) inet_res: /etc/resolv.conf: use domain as default search list inet: delayed/avoided read of /etc/resolv.conf and /etc/hosts inet_gethost_native: workaround for empty result hostname on MacOS X inet_res_SUITE: testcase fix for empty domain name inet:gethostbyname improved to parse IP strings and look up own hostname OTP-8426 The resolver routines failed to look up the own node name as hostname, if the OS native resolver was erroneously configured, bug reported by Yogish Baliga, now fixed. The resolver routines now tries to parse the hostname as an IP string as most OS resolvers do, unless the native resolver is used. The DNS resolver inet_res and file resolver inet_hosts now do not read OS configuration files until they are needed. Since the native resolver is default, in most cases they are never needed. The DNS resolver's automatic updating of OS configuration file data (/etc/resolv.conf) now uses the 'domain' keyword as default search domain if there is no 'search' keyword.
Diffstat (limited to 'lib/kernel/src/inet_config.erl')
-rw-r--r--lib/kernel/src/inet_config.erl32
1 files changed, 18 insertions, 14 deletions
diff --git a/lib/kernel/src/inet_config.erl b/lib/kernel/src/inet_config.erl
index b5317f72f5..311e6bc9f9 100644
--- a/lib/kernel/src/inet_config.erl
+++ b/lib/kernel/src/inet_config.erl
@@ -1,19 +1,19 @@
%%
%% %CopyrightBegin%
-%%
-%% Copyright Ericsson AB 1997-2009. All Rights Reserved.
-%%
+%%
+%% Copyright Ericsson AB 1997-2010. All Rights Reserved.
+%%
%% The contents of this file are subject to the Erlang Public License,
%% Version 1.1, (the "License"); you may not use this file except in
%% compliance with the License. You should have received a copy of the
%% Erlang Public License along with this software. If not, it can be
%% retrieved online at http://www.erlang.org/.
-%%
+%%
%% Software distributed under the License is distributed on an "AS IS"
%% basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
%% the License for the specific language governing rights and limitations
%% under the License.
-%%
+%%
%% %CopyrightEnd%
%%
-module(inet_config).
@@ -130,21 +130,25 @@ init() ->
{unix,_} ->
%% The Etc variable enables us to run tests with other
%% configuration files than the normal ones
- Etc = case os:getenv("ERL_INET_ETC_DIR") of
- false -> ?DEFAULT_ETC;
- _EtcDir ->
- _EtcDir
- end,
+ Etc =
+ case os:getenv("ERL_INET_ETC_DIR") of
+ false ->
+ ?DEFAULT_ETC;
+ _EtcDir ->
+ _EtcDir
+ end,
case inet_db:res_option(resolv_conf) of
undefined ->
- inet_db:set_resolv_conf(filename:join(Etc,
- ?DEFAULT_RESOLV));
+ inet_db:res_option(
+ resolv_conf_name,
+ filename:join(Etc, ?DEFAULT_RESOLV));
_ -> ok
end,
case inet_db:res_option(hosts_file) of
undefined ->
- inet_db:set_hosts_file(filename:join(Etc,
- ?DEFAULT_HOSTS));
+ inet_db:res_option(
+ hosts_file_name,
+ filename:join(Etc, ?DEFAULT_HOSTS));
_ -> ok
end;
_ -> ok