无需修改 /etc/hosts Mac OS X 即可自定义 DNS

发布于 2025-01-07 03:11:27 字数 186 浏览 4 评论 0原文

如何创建一个 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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(3

故事↓在人 2025-01-14 03:11:27

它不是 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

虐人心 2025-01-14 03:11:27

我更喜欢使用 powderPow 的包装)。它易于安装且易于使用。您所要做的只是创建一个指向您的项目目录的链接,它会自动为您创建域名,而无需修改您的 hosts 文件。

I prefer using powder (a wrapper for Pow). 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 your hosts file.

悲念泪 2025-01-14 03:11:27

防毒面具是我用来修改主机配置的首选工具。您可以创建多个主机文件并根据需要在它们之间切换。

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.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文