diff --git a/README.md b/README.md index 9d0f77f..a2ac936 100644 --- a/README.md +++ b/README.md @@ -87,6 +87,7 @@ python run.py -c /path/to/config.json * `default` 系统访问外网默认IP * `public`使用公网ip(使用公网API查询) * `nku` NKU网关ip(只支持ipv4) +* `none` 不更新ipv4/ipv6的DNS解析 ### 配置示例 ```json diff --git a/run.py b/run.py index 7758903..58ab8ef 100755 --- a/run.py +++ b/run.py @@ -62,7 +62,9 @@ def get_ip(ip_type): get IP address """ index = get_config('index' + ip_type) or "default" - if str(index).isdigit(): # local eth + if index == 'none': + return None + elif str(index).isdigit(): # local eth value = getattr(ip, "local_v" + ip_type)(index) elif any((c in index) for c in '*.:'): # regex value = getattr(ip, "regex_v" + ip_type)(index)