Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

OS X DNS resolver w/o internet connection. #113

Closed
scythian opened this issue Feb 1, 2017 · 5 comments
Closed

OS X DNS resolver w/o internet connection. #113

scythian opened this issue Feb 1, 2017 · 5 comments
Assignees
Milestone

Comments

@scythian
Copy link

scythian commented Feb 1, 2017

OS X has a bag or feature, when DNS resolver wont work without internet connection. In case of loosing Wi-Fi or LAN, local environment (for example "test.docksal") becomes unavailable.
Problem can be solved in case of manual updating "/etc/hosts" file (e.g. "192.168.64.100 test.docksal"), same way as MAMP stack doing.
As variant separate "init" command for OS X should be implemented or existing "init" script updated, with adding OS validation and updating "hosts" file.

@achekulaev achekulaev added this to the 1.3 milestone Mar 4, 2017
achekulaev added a commit that referenced this issue Apr 15, 2017
Can add/remove a host to/from OS-dependent hosts file. Relates to #113
@achekulaev
Copy link
Member

In the commit referenced above I have added a fin hosts commands subset.
It will allow adding lines to OS-dependent hosts file.
fin will not append lines there automatically but you can use it in your init scripts to do that if required.
e.g. fin hosts add test.docksal

@achekulaev
Copy link
Member

achekulaev commented May 6, 2017

Hosts command improved so that without parameters fin hosts add and fin hosts remove will use VIRTUAL_HOST of a current project.

Now people writing init script can do something like this

if is_windows; then
  cd "$PROJECT_ROOT"
  fin hosts add
fi

Or if you go offline on macOS you can just od fin hosts add.

This command is the best I can do for using Docksal offline. As I don't want to force user to change his hosts file by default.

@achekulaev
Copy link
Member

achekulaev commented May 6, 2017

For scripting purposes. On macOS checking if user is offline can be done like this:

if ping -c 1 google.com >> /dev/null 2>&1; then
    echo "online"
else
    echo "offline"
fi

@loopy3025
Copy link

loopy3025 commented Sep 6, 2020

I see this issue was resolved but I'm having some reading comprehension issues with the post. I don't understand the solution. Is there a guide on how I get docksal running on a Mac that's offline?

@achekulaev
Copy link
Member

Use fin hosts commands subset or edit hosts file manually. There is no other way

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants