Skip to content

Instantly share code, notes, and snippets.

@starbelly
Created August 22, 2023 12:00
Show Gist options
  • Save starbelly/27c2f1e8da56356b99151b0673d1bd38 to your computer and use it in GitHub Desktop.
Save starbelly/27c2f1e8da56356b99151b0673d1bd38 to your computer and use it in GitHub Desktop.
inet_db_test.erl
Erlang/OTP 26 [erts-14.0.2] [source] [64-bit] [smp:8:8] [ds:8:8:10] [async-threads:1] [jit]
Eshell V14.0.2 (press Ctrl+G to abort, type help(). for help)
1> inet_res:gethostbyname("rebar3.s3.amazonaws.com").
hostent_by_domain: "rebar3.s3.amazonaws.com"
hostent_by_domain: "rebar3.s3.amazonaws.com.local"
res_hostent_by_domain: "rebar3.s3.amazonaws.com" - [{dns_rr,
"rebar3.s3.amazonaws.com",
cname,in,0,42821,
"s3-1-w.amazonaws.com",
undefined,
"rebar3.s3.amazonaws.com",
false},
{dns_rr,
"s3-1-w.amazonaws.com",
cname,in,0,238,
"s3-w.us-east-1.amazonaws.com",
undefined,
"s3-1-w.amazonaws.com",
false},
{dns_rr,
"s3-w.us-east-1.amazonaws.com",
a,in,0,59,
{52,217,140,25},
undefined,
"s3-w.us-east-1.amazonaws.com",
false},
{dns_rr,
"s3-w.us-east-1.amazonaws.com",
a,in,0,59,
{52,216,152,196},
undefined,
"s3-w.us-east-1.amazonaws.com",
false},
{dns_rr,
"s3-w.us-east-1.amazonaws.com",
a,in,0,59,
{52,216,145,35},
undefined,
"s3-w.us-east-1.amazonaws.com",
false},
{dns_rr,
"s3-w.us-east-1.amazonaws.com",
a,in,0,59,
{54,231,204,9},
undefined,
"s3-w.us-east-1.amazonaws.com",
false},
{dns_rr,
"s3-w.us-east-1.amazonaws.com",
a,in,0,59,
{16,182,96,49},
undefined,
"s3-w.us-east-1.amazonaws.com",
false},
{dns_rr,
"s3-w.us-east-1.amazonaws.com",
a,in,0,59,
{52,216,108,147},
undefined,
"s3-w.us-east-1.amazonaws.com",
false},
{dns_rr,
"s3-w.us-east-1.amazonaws.com",
a,in,0,59,
{52,217,138,193},
undefined,
"s3-w.us-east-1.amazonaws.com",
false},
{dns_rr,
"s3-w.us-east-1.amazonaws.com",
a,in,0,59,
{52,217,99,44},
undefined,
"s3-w.us-east-1.amazonaws.com",
false}]
add_rrs: [{dns_rr,"rebar3.s3.amazonaws.com",cname,in,-576460749,42821,
"s3-1-w.amazonaws.com",-576460749,"rebar3.s3.amazonaws.com",
false},
{dns_rr,"s3-1-w.amazonaws.com",cname,in,-576460749,238,
"s3-w.us-east-1.amazonaws.com",-576460749,
"s3-1-w.amazonaws.com",false},
{dns_rr,"s3-w.us-east-1.amazonaws.com",a,in,-576460749,59,
{52,217,140,25},
-576460749,"s3-w.us-east-1.amazonaws.com",false},
{dns_rr,"s3-w.us-east-1.amazonaws.com",a,in,-576460749,59,
{52,216,152,196},
-576460749,"s3-w.us-east-1.amazonaws.com",false},
{dns_rr,"s3-w.us-east-1.amazonaws.com",a,in,-576460749,59,
{52,216,145,35},
-576460749,"s3-w.us-east-1.amazonaws.com",false},
{dns_rr,"s3-w.us-east-1.amazonaws.com",a,in,-576460749,59,
{54,231,204,9},
-576460749,"s3-w.us-east-1.amazonaws.com",false},
{dns_rr,"s3-w.us-east-1.amazonaws.com",a,in,-576460749,59,
{16,182,96,49},
-576460749,"s3-w.us-east-1.amazonaws.com",false},
{dns_rr,"s3-w.us-east-1.amazonaws.com",a,in,-576460749,59,
{52,216,108,147},
-576460749,"s3-w.us-east-1.amazonaws.com",false},
{dns_rr,"s3-w.us-east-1.amazonaws.com",a,in,-576460749,59,
{52,217,138,193},
-576460749,"s3-w.us-east-1.amazonaws.com",false},
{dns_rr,"s3-w.us-east-1.amazonaws.com",a,in,-576460749,59,
{52,217,99,44},
-576460749,"s3-w.us-east-1.amazonaws.com",false}]
{ok,{hostent,"s3-w.us-east-1.amazonaws.com",
["s3-1-w.amazonaws.com","rebar3.s3.amazonaws.com"],
inet,4,
[{52,217,140,25},
{52,216,152,196},
{52,216,145,35},
{54,231,204,9},
{16,182,96,49},
{52,216,108,147},
{52,217,138,193},
{52,217,99,44}]}}
2> inet_res:gethostbyname("rebar3.s3.amazonaws.com").
hostent_by_domain: "rebar3.s3.amazonaws.com"
{ok,{hostent,"s3-w.us-east-1.amazonaws.com",
["s3-1-w.amazonaws.com","rebar3.s3.amazonaws.com"],
inet,4,
[{52,217,140,25},
{52,216,152,196},
{52,216,145,35},
{54,231,204,9},
{16,182,96,49},
{52,216,108,147},
{52,217,138,193},
{52,217,99,44}]}}
3> inet_res:gethostbyname("rebar3.s3.amazonaws.com").
hostent_by_domain: "rebar3.s3.amazonaws.com"
{ok,{hostent,"s3-w.us-east-1.amazonaws.com",
["s3-1-w.amazonaws.com","rebar3.s3.amazonaws.com"],
inet,4,
[{52,217,140,25},
{52,216,152,196},
{52,216,145,35},
{54,231,204,9},
{16,182,96,49},
{52,216,108,147},
{52,217,138,193},
{52,217,99,44}]}}
4> inet_res:gethostbyname("rebar3.s3.amazonaws.com").
hostent_by_domain: "rebar3.s3.amazonaws.com"
{ok,{hostent,"s3-w.us-east-1.amazonaws.com",
["s3-1-w.amazonaws.com","rebar3.s3.amazonaws.com"],
inet,4,
[{52,217,140,25},
{52,216,152,196},
{52,216,145,35},
{54,231,204,9},
{16,182,96,49},
{52,216,108,147},
{52,217,138,193},
{52,217,99,44}]}}
5> io:format("~s~n", ["Wait a few minutes..."]).
Wait a few minutes...
ok
6> ets:tab2list(inet_cache).
[{dns_rr,"rebar3.s3.amazonaws.com",cname,in,-576460747,
42821,"s3-1-w.amazonaws.com",-576460749,
"rebar3.s3.amazonaws.com",false},
{dns_rr,"s3-1-w.amazonaws.com",cname,in,-576460747,238,
"s3-w.us-east-1.amazonaws.com",-576460749,
"s3-1-w.amazonaws.com",false}]
7> inet_res:gethostbyname("rebar3.s3.amazonaws.com").
hostent_by_domain: "rebar3.s3.amazonaws.com"
hostent_by_domain: "rebar3.s3.amazonaws.com.local"
res_hostent_by_domain: "rebar3.s3.amazonaws.com" - [{dns_rr,
"rebar3.s3.amazonaws.com",
cname,in,0,42821,
"s3-1-w.amazonaws.com",
undefined,
"rebar3.s3.amazonaws.com",
false},
{dns_rr,
"s3-1-w.amazonaws.com",
cname,in,0,233,
"s3-w.us-east-1.amazonaws.com",
undefined,
"s3-1-w.amazonaws.com",
false},
{dns_rr,
"s3-w.us-east-1.amazonaws.com",
a,in,0,60,
{52,216,61,241},
undefined,
"s3-w.us-east-1.amazonaws.com",
false},
{dns_rr,
"s3-w.us-east-1.amazonaws.com",
a,in,0,60,
{54,231,130,161},
undefined,
"s3-w.us-east-1.amazonaws.com",
false},
{dns_rr,
"s3-w.us-east-1.amazonaws.com",
a,in,0,60,
{52,216,105,179},
undefined,
"s3-w.us-east-1.amazonaws.com",
false},
{dns_rr,
"s3-w.us-east-1.amazonaws.com",
a,in,0,60,
{52,217,81,236},
undefined,
"s3-w.us-east-1.amazonaws.com",
false},
{dns_rr,
"s3-w.us-east-1.amazonaws.com",
a,in,0,60,
{52,217,49,12},
undefined,
"s3-w.us-east-1.amazonaws.com",
false},
{dns_rr,
"s3-w.us-east-1.amazonaws.com",
a,in,0,60,
{54,231,134,233},
undefined,
"s3-w.us-east-1.amazonaws.com",
false},
{dns_rr,
"s3-w.us-east-1.amazonaws.com",
a,in,0,60,
{52,216,33,81},
undefined,
"s3-w.us-east-1.amazonaws.com",
false},
{dns_rr,
"s3-w.us-east-1.amazonaws.com",
a,in,0,60,
{52,217,82,220},
undefined,
"s3-w.us-east-1.amazonaws.com",
false}]
add_rrs: [{dns_rr,"rebar3.s3.amazonaws.com",cname,in,-576460671,42821,
"s3-1-w.amazonaws.com",-576460671,"rebar3.s3.amazonaws.com",
false},
{dns_rr,"s3-1-w.amazonaws.com",cname,in,-576460671,233,
"s3-w.us-east-1.amazonaws.com",-576460671,
"s3-1-w.amazonaws.com",false},
{dns_rr,"s3-w.us-east-1.amazonaws.com",a,in,-576460671,60,
{52,216,61,241},
-576460671,"s3-w.us-east-1.amazonaws.com",false},
{dns_rr,"s3-w.us-east-1.amazonaws.com",a,in,-576460671,60,
{54,231,130,161},
-576460671,"s3-w.us-east-1.amazonaws.com",false},
{dns_rr,"s3-w.us-east-1.amazonaws.com",a,in,-576460671,60,
{52,216,105,179},
-576460671,"s3-w.us-east-1.amazonaws.com",false},
{dns_rr,"s3-w.us-east-1.amazonaws.com",a,in,-576460671,60,
{52,217,81,236},
-576460671,"s3-w.us-east-1.amazonaws.com",false},
{dns_rr,"s3-w.us-east-1.amazonaws.com",a,in,-576460671,60,
{52,217,49,12},
-576460671,"s3-w.us-east-1.amazonaws.com",false},
{dns_rr,"s3-w.us-east-1.amazonaws.com",a,in,-576460671,60,
{54,231,134,233},
-576460671,"s3-w.us-east-1.amazonaws.com",false},
{dns_rr,"s3-w.us-east-1.amazonaws.com",a,in,-576460671,60,
{52,216,33,81},
-576460671,"s3-w.us-east-1.amazonaws.com",false},
{dns_rr,"s3-w.us-east-1.amazonaws.com",a,in,-576460671,60,
{52,217,82,220},
-576460671,"s3-w.us-east-1.amazonaws.com",false}]
{ok,{hostent,"s3-w.us-east-1.amazonaws.com",
["s3-1-w.amazonaws.com","rebar3.s3.amazonaws.com"],
inet,4,
[{52,216,61,241},
{54,231,130,161},
{52,216,105,179},
{52,217,81,236},
{52,217,49,12},
{54,231,134,233},
{52,216,33,81},
{52,217,82,220}]}}
8> inet_res:gethostbyname("rebar3.s3.amazonaws.com").
hostent_by_domain: "rebar3.s3.amazonaws.com"
{ok,{hostent,"s3-w.us-east-1.amazonaws.com",
["s3-1-w.amazonaws.com","rebar3.s3.amazonaws.com"],
inet,4,
[{52,216,61,241},
{54,231,130,161},
{52,216,105,179},
{52,217,81,236},
{52,217,49,12},
{54,231,134,233},
{52,216,33,81},
{52,217,82,220}]}}
9> inet_res:gethostbyname("rebar3.s3.amazonaws.com").
hostent_by_domain: "rebar3.s3.amazonaws.com"
{ok,{hostent,"s3-w.us-east-1.amazonaws.com",
["s3-1-w.amazonaws.com","rebar3.s3.amazonaws.com"],
inet,4,
[{52,216,61,241},
{54,231,130,161},
{52,216,105,179},
{52,217,81,236},
{52,217,49,12},
{54,231,134,233},
{52,216,33,81},
{52,217,82,220}]}}
10> inet_res:gethostbyname("rebar3.s3.amazonaws.com").
hostent_by_domain: "rebar3.s3.amazonaws.com"
{ok,{hostent,"s3-w.us-east-1.amazonaws.com",
["s3-1-w.amazonaws.com","rebar3.s3.amazonaws.com"],
inet,4,
[{52,216,61,241},
{54,231,130,161},
{52,216,105,179},
{52,217,81,236},
{52,217,49,12},
{54,231,134,233},
{52,216,33,81},
{52,217,82,220}]}}
11> inet_res:gethostbyname("rebar3.s3.amazonaws.com").
hostent_by_domain: "rebar3.s3.amazonaws.com"
{ok,{hostent,"s3-w.us-east-1.amazonaws.com",
["s3-1-w.amazonaws.com","rebar3.s3.amazonaws.com"],
inet,4,
[{52,216,61,241},
{54,231,130,161},
{52,216,105,179},
{52,217,81,236},
{52,217,49,12},
{54,231,134,233},
{52,216,33,81},
{52,217,82,220}]}}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment