I am able to ssh into a machine running in the app “geo-demo”. I am trying to resolve “geo-db2.internal” which is in the app “geo-db2”. Are there issues connecting across apps?
Resolves OK using ping:
$ ping geo-db2.internal
PING geo-db2.internal(e2860759ae4286.vm.geo-db2.internal (fdaa:0:797a:a7b:4b7:11b9:5b03:2)) 56 data bytes
Does not work in iex:
:inet_res.gethostbyname('geo-db2.internal')
warning: using single-quoted strings to represent charlists is deprecated.
Use ~c"" if you indeed want a charlist or use "" instead.
You may run "mix format --migrate" to change all single-quoted
strings to use the ~c sigil and fix this warning.
└─ iex:1:25
{:error, :nxdomain}
Adding the :inet6 atom works. However, Ecto / Postgres client is not using it. Is there an option somewhere in the database connection config?
:inet_res.gethostbyname('geo-demo-db.internal', :inet6)
warning: using single-quoted strings to represent charlists is deprecated.
Use ~c"" if you indeed want a charlist or use "" instead.
You may run "mix format --migrate" to change all single-quoted
strings to use the ~c sigil and fix this warning.
└─ iex:2:25
{:ok,
{:hostent, ~c"geo-demo-db.internal", [], :inet6, 16,
[{64938, 0, 31098, 2683, 1212, 34122, 15906, 2}]}}
Just to show it doesn’t work without the atom…
:inet_res.gethostbyname('geo-demo-db.internal')
warning: using single-quoted strings to represent charlists is deprecated.
Use ~c"" if you indeed want a charlist or use "" instead.
You may run "mix format --migrate" to change all single-quoted
strings to use the ~c sigil and fix this warning.
└─ iex:4:25
{:error, :nxdomain}