Git Product home page Git Product logo

Comments (18)

taher-pro avatar taher-pro commented on August 15, 2024 2

@hussainweb

Thank you for all of the above.

After detailed debugging and following the steps mentioned I found

  1. We need to add the DNS to mac using networksetup -setdnsservers Wi-Fi 127.0.0.1 192.168.0.1
  2. I was not restarting locally installed dnsmasq using sudo. Strangely restarting it without sudo does give a false positive. -- This was isolated by using dig.

I will supply a patch for the documentation inline with my learnings shortly.

from docs.

dustinleblanc avatar dustinleblanc commented on August 15, 2024 2

I had no clue .dev was a no go, wowsers! I've been using that for quite some time (hence the documentation). All four of tld's they list as safe look absolutely lame, but I guess .localhost makes semantic sense...

I'd definitely support updating it so folks don't run into that issue. I like to err on the side of humor as the Lando team have, so pick something comical imo 🥇

from docs.

hussainweb avatar hussainweb commented on August 15, 2024 1

Okay, I reread and realised what happened. I should have clarified that add on 127.0.0.1 to output from existing entries from networksetup -getdnsservers Wi-Fi. Can you manually set it to your router's IP address for now?

e.g., networksetup -setdnsservers Wi-Fi 127.0.0.1 192.168.0.1 Replace 192.168.0.1 with your router's address.

from docs.

hussainweb avatar hussainweb commented on August 15, 2024 1

I got stuck on the second issue as well. There is no error, but apparently it cannot bind to system ports as a regular user. It is an important gotcha for sure. :)

from docs.

hussainweb avatar hussainweb commented on August 15, 2024

Unless I am mistaken, I think there is something missing in the documentation. The documentation only covers running a DNS server locally (dnsmasq), but does not talk about getting Mac OS X to find the nameserver. Most references I found about adding the TLD to /etc/resolver/TLD did not work for me.

After a bit of reading, I found that this address has to be added either via the System Preferences app (search for 'DNS') or the networksetup -setdnsservers Wi-Fi 127.0.0.1 command.

from docs.

taher-pro avatar taher-pro commented on August 15, 2024

@hussainweb

Thank you for the analysis!

After a bit of reading, I found that this address has to be added either via the System Preferences app (search for 'DNS') or the networksetup -setdnsservers Wi-Fi 127.0.0.1 command.

Is ☝️ working for you?

Unfortunately in my case when I add 127.0.0.1 as a DNS, All the internet pages throw up DNS_PROBE_FINISHED_NXDOMAIN error along with http://taher.local , https://taher.local

from docs.

hussainweb avatar hussainweb commented on August 15, 2024

@taherj Yes, I tried it and it worked. Make sure that 127.0.0.1 is the first IP in the list. Double check with scutil --dns.

Also, try running dig taher.local @127.0.0.1 to see if dnsmasq is working properly.

from docs.

hussainweb avatar hussainweb commented on August 15, 2024

On further reading, I found that there is an issue with .local TLD (not conclusive). In my case, dig was working fine but ping wasn't. Like suggested by the answer, I simply tried another TLD .site. Both dig and ping work fine now.

EDIT: More info: https://en.wikipedia.org/wiki/.local

from docs.

hussainweb avatar hussainweb commented on August 15, 2024

I see this documentation was added in #106 and the link over there is the one I referred to as well. However, the documentation missed out on the last section which is to let OS X know to check dnsmasq as well.

from docs.

Mchampsee avatar Mchampsee commented on August 15, 2024

Have you tried visiting http://localhost:32896 ?

from docs.

taher-pro avatar taher-pro commented on August 15, 2024

@Mchampsee Yes http://localhost:32896 works.
The goal here is to get the TLD to work while we are offline.

from docs.

dustinleblanc avatar dustinleblanc commented on August 15, 2024

I wrote that doc page, huh, weird. I ran through the whole thing and had no issues, but it may be because I had DNSMasq running previously and tore down / rebuilt, so maybe it had some preset magic going. It may also be possible that High Sierra changed something about the setup. The .local domain issue would definitely cause problems, but I've never, ever had to do the whole networksetup -setdnsservers Wi-Fi 127.0.0.1 business, I'd question if that is necessary. The need to add sudo to the restart of DNSMasq could definitely have been something I missed.

from docs.

taher-pro avatar taher-pro commented on August 15, 2024

@dustinleblanc Would you please inform regarding the following :

  1. Which macOS version you are using for the documentation?
  2. Do you have 127.0.0.1 added in your networks entry already?

I understand the issue with the .local TLD. I have since changed it to .dev (as per the documentation) and checked as well. It does not seem to work on any browser without adding the 127.0.0.1 to the DNS.

It is probably a macOS High Sierra specific issue. I would propose we keep the docs updated to include these edge cases as well.

Thoughts??

Edit 1: @dustinleblanc You are right. Ideally, we don't really need networksetup -setdnsservers Wi-Fi 127.0.0.1. Here is a summary :

  1. Inform users to avoid using .local,.dev ( Google 😞 ) TLDs. refer 1, 2
  2. If the user really needs/want to use .dev or any other reserved TLDs they need to add the DNS locally using networksetup -setdnsservers Wi-Fi 127.0.0.1 <router_ip>

The current documentation has .dev TLD as the example so including 2 makes sense. Or we can update any other TLD instead of .local,.dev in the example and we don't need not handle the DNS entry business altogether.

Thoughts??

from docs.

jbertoen avatar jbertoen commented on August 15, 2024

Definitely recommend .localhost as well.
What also might help with some dns issues on OSX is doing a
dscacheutil -flushcache

from docs.

jbertoen avatar jbertoen commented on August 15, 2024

I can't get localhost working without doing the following steps:

For OS X to resolve requests from *.local to localhost we need to add a resolver:

$ sudo mkdir /etc/resolver
$ sudo touch /etc/resolver/local
edit /etc/resolver/local

nameserver 127.0.0.1

re-start the computer to enable the resolver

from docs.

jbertoen avatar jbertoen commented on August 15, 2024

@pirog, I updated the documentation to get it working on OS X and also added the recommendation to not use *.dev as a TLD for development.

from docs.

pirog avatar pirog commented on August 15, 2024

@jbertoen awesome! thanks so much.

from docs.

kamalkech avatar kamalkech commented on August 15, 2024

@jbertoen i had the same issue on archlinux (manjaro), there is another configuration for my system ??

from docs.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.