mirror of
https://github.com/yswery/PHP-DNS-SERVER.git
synced 2026-04-26 09:45:54 +03:00
[GH-ISSUE #38] Local filesystem provider #13
Labels
No labels
bug
enhancement
enhancement
hacktoberfest
pull-request
question
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
starred/PHP-DNS-SERVER#13
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @Muffinman on GitHub (Nov 10, 2017).
Original GitHub issue: https://github.com/yswery/PHP-DNS-SERVER/issues/38
Hi,
Just thought you might like to know that I've forked and added support for local filesystem lookups.
e.g.
host -a dev.example.com 127.0.0.1could check to see if/path/to/example.comexists locally and return 127.0.0.1 if found.It can also be configured to work with domain suffixes e.g.
example.com.devorexample.com.localhostI'm finding this useful for local web development as I don't need to keep editing my hosts file every time I work on a new site, providing my folder structure is consistent.
Wasn't sure if that functionality was within the scope of this project so I didn't want to open as a PR.
https://github.com/Muffinman/PHP-DNS-SERVER/blob/master/src/DirStorageProvider.php
@codenamegary commented on GitHub (Apr 15, 2018):
That is clever and it looks really good! You should open a PR.
@Muffinman commented on GitHub (Apr 15, 2018):
Unfortunately although the DNS server seemed to work fine, I found that half the time chrome would just fail rather than pass requests to the local DNS server.
Didn't have time to debug it properly and eventually just went back to editing my hosts file.
@codenamegary commented on GitHub (Apr 18, 2018):
I believe that's entirely due to this change in Chrome, specific to the ".dev" TLD.
https://laravel-news.com/chrome-63-now-forces-dev-domains-https
This will probably still work fine if you use .local or something along those lines.
@Muffinman commented on GitHub (Apr 20, 2018):
Not in my case, my local domain formats are dev.example.com so that my password manager picks up the correct passwords for the parent domain.
It really did seem random where it would work for some domains but not others, and then would randomly stop working all together.
I'm pretty sure it was something specific to Chrome as any
dig/hostlookups worked perfectly from the command line, as did Safari when I tested that.If I had to guess I would say it's a limitation of hosting a DNS service on localhost / 127.0.0.1, maybe if I bound it to another IP it may work.