@TheLumberjack @mike.gorman @qrkourier
I have set up a Zrok instance hosted on AWS, and everything is working correctly there. However, when I attempt to use Zrok on my local machine, I encounter an error during the share
command execution.
Environment Details
AWS Instance (Working Setup)
ubuntu@ip-172-31-46-125:~$ zrok status
Config:
CONFIG VALUE SOURCE
apiEndpoint http://127.0.0.1:18080 env
defaultFrontend public binary
Environment:
PROPERTY VALUE
Secret Token <<SET>>
Ziti Identity <<SET>>
Command executed on AWS instance:
ubuntu@ip-172-31-46-125:~$ zrok share public http://localhost:7899 --headless
[ 0.134] INFO sdk-golang/ziti.(*listenerManager).createSessionWithBackoff: {session token=[860088a9-3006-4631-8592-cdbedf3db9d2]} new service session
[ 0.175] INFO main.(*sharePublicCommand).run: access your zrok share at the following endpoints:
https://qdgrkjjbj3sc.chain.ziglinkzag.com
Local Machine (Error Setup)
(base) john@local-machine zrok_0.4.37_darwin_arm64 % ./zrok status
Config:
CONFIG VALUE SOURCE
apiEndpoint https://api.chain.ziglinkzag.com env
defaultFrontend public binary
Environment:
PROPERTY VALUE
Secret Token <<SET>>
Ziti Identity <<SET>>
Command executed on local machine:
(base) john@local-machine zrok_0.4.37_darwin_arm64 % ./zrok share public http://localhost:7899
[ERROR]: error creating proxy backend (error listening: failed to listen: no apiSession, authentication attempt failed: Post "https://ip-172-31-46-125:8441/edge/client/v1/authenticate?method=cert": dial tcp: lookup ip-172-31-46-125: no such host)
Problem
On my local machine, I get the following error:
error creating proxy backend (error listening: failed to listen: no apiSession, authentication attempt failed: Post "https://ip-172-31-46-125:8441/edge/client/v1/authenticate?method=cert": dial tcp: lookup ip-172-31-46-125: no such host)
Expected Behavior
The share
command should work on the local machine as it does on the AWS instance, allowing me to access the shared endpoint.
Actual Behavior
The command fails with a "no such host" error, indicating that it cannot resolve the AWS instance hostname.
Workaround
I found a temporary workaround by adding the AWS instance's public IP to my local /etc/hosts
file. The following entry resolves the issue:
sudo nano /etc/hosts
Add the following line:
<aws-public-ip> ip-172-31-46-125
With this change, the command works as expected on my local machine.
Additional Information
- Zrok Version:
0.4.37
- Local Machine: macOS (Darwin ARM64)
- API Endpoint on Local Machine:
https://api.chain.ziglinkzag.com
- API Endpoint on AWS Instance:
http://127.0.0.1:18080
Possible Cause
It appears that the issue is related to DNS resolution. The local machine cannot resolve the AWS instance's hostname (ip-172-31-46-125
) without manually updating the /etc/hosts
file.
Request
Could you please provide guidance on a more permanent solution or configuration change that would avoid the need to update the /etc/hosts
file manually?