无需修改 /etc/hosts Mac OS X 即可自定义 DNS
如何创建一个 Ruby 脚本来将任意主机名分配给任意 IP?在某一时刻,这可以使用 ghost 来完成,但它似乎不再在 Mac OS X 10.7.3 下工作。是否可以在不修改每个用户级别的 /etc/hosts 的情况下完成?谢谢。
How would one create a Ruby script that will assign an arbitrary host name to an arbitrary IP? At one point this could be done using ghost however it no longer appears to works under Mac OS X 10.7.3. Can it be done without modifying /etc/hosts on a per user level? Thanks.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
它不是 ruby,但你见过 Pow! 吗?它恰好是在 Node.js 中实现的,并设置一个 dns 服务器,让您的浏览器动态地认为您的系统是其他主机名。
HTH,
凯尔
It's not ruby, but have you seen Pow!? It happens to be implemented in node.js, and sets up a dns server to make your browser think your system is the other host names - dynamically.
HTH,
Kyle
我更喜欢使用
powder
(Pow
的包装)。它易于安装且易于使用。您所要做的只是创建一个指向您的项目目录的链接,它会自动为您创建域名,而无需修改您的hosts
文件。I prefer using
powder
(a wrapper forPow
). It is easy to install and easy to use. Everything you'll have to do is simply create a link to your project directory and it will automatically create domain name for you without modifying of yourhosts
file.防毒面具是我用来修改主机配置的首选工具。您可以创建多个主机文件并根据需要在它们之间切换。
Gas mask is my tool of choice for mucking around with my hosts config. You can create multiple host files and switch between them as you like.