wildcard in hosts file

后端 未结 4 1824
花落未央
花落未央 2021-02-10 16:48

It\'s not possible to use a wildcard in the hosts file on windows or linux. Is there a way to do it with a browser plugin or something else?

I have a dev server on a vbo

4条回答
  •  陌清茗
    陌清茗 (楼主)
    2021-02-10 17:30

    I made this simple tool to take the place of hosts. Regular expressions are supported. https://github.com/stackia/DNSAgent Windows only. Probably working with Mono.

    A sample configuration:

    [
        {
            "Pattern": "^.*$",
            "NameServer": "8.8.8.8"
        },
        {
            "Pattern": "^(.*\\.googlevideo\\.com)|((.*\\.)?(youtube|ytimg)\\.com)$",
            "Address": "203.66.168.119"
        },
        {
            "Pattern": "^.*\\.cn$",
            "NameServer": "114.114.114.114"
        },
        {
            "Pattern": "baidu.com$",
            "Address": "127.0.0.1"
        }
    ]
    

提交回复
热议问题