来源:systemd 项目《systemd-resolved.service and VPNs》。本文依原文全文译编,核对日期为 2026 年 10 月 5 日;原页没有个人作者署名。原文采用 LGPL-2.1-or-later,译编与补充已在文中标明。
同时连接公司 VPN、隐私 VPN 和家中 Wi-Fi 时,DNS 配置不应只是“选一个服务器”。公司内网名称需要交给公司的 DNS,普通互联网名称应交给隐私 VPN,而本地路由器的管理名称可能仍需由 Wi-Fi 上的 DNS 解析。systemd-resolved 可以按域名后缀将查询分配到不同接口,解决的正是这种多网络并存的问题。
本文只讨论经过 systemd-resolved 的 DNS 选路。DNS 的接口选择、到 DNS 服务器的 IP 路由、VPN 隧道和防火墙策略是不同层面的配置;应用自带的 DoH 等解析路径也可能绕过系统解析器。这里的设置本身不构成完整的防泄漏保证。

先区分 VPN 的两种目的
企业 VPN 用于访问一组额外的内部主机。只有公司的相关域名应交给 VPN 的 DNS;与公司无关的名称,继续通过其他接口解析。
隐私 VPN 的目标是:连接建立后,普通 DNS 流量都优先使用 VPN 的 DNS,避免继续发送到常规网络上的服务器。要实现这一目标,必须理解路由域的优先级;一个兜底配置不会盖过所有更具体的规则。
搜索域、路由域和 default-route
搜索域用于给没有限定的单标签名称添加后缀,例如将 printer 补成某个完整域名。传统系统通常把搜索域挂在整台机器的 IP 配置上,systemd-resolved 则将它们关联到接口;这些信息可能来自 DHCP、IPv6RA 或 PPP 等网络配置机制。
搜索域同时参与 DNS 选路。给某接口配置 foo.com 后,查询 foo.com 本身或任何以 .foo.com 结尾的名称时,该接口的 DNS 会得到优先考虑。
路由域只参与选路,不给单标签名称追加后缀。它与搜索域的匹配行为相同,显示时在前面加 ~:foo.com 是搜索域,~foo.com 是路由域。很多场合只希望把公司的完整名称交给公司解析器,并不希望改变 printer 这种短名称的含义,此时路由域更合适。不过,传统的 DHCP、IPv6RA、PPP 租约并不普遍提供这一概念,VPN 软件需要自行转换或补充。
~. 是一个特殊的路由域。DNS 中的点表示根域,所有域名都在其下,因此它可作为兜底规则。直接配置搜索域 . 也会产生类似选路效果,但给短名称补一个点没有多少实用意义,通常使用 ~.。
路由域也适用于反向解析。IPv4 反查使用 in-addr.arpa,IPv6 反查使用 ip6.arpa。例如,~168.192.in-addr.arpa 可将 192.168.x.y 地址的反查优先交给指定接口。实际部署时,应从真正受 VPN 管理的地址范围推导相应反查域,不能机械照抄示例。
default-route是每接口的 DNS 布尔设置,不是内核的默认 IP 路由。设为 true 时,没有匹配搜索域或路由域的 DNS 查询可以交给该接口;设为 false 时,该接口只接收与其域列表匹配的查询。如果接口没有任何搜索域或路由域,且此值为 false,它就不会成为这些 DNS 查询的候选路径。
版本说明:原指南将 true 简述为默认值。当前 systemd 手册还说明,未显式设置时可能依据接口的路由域自动推断。因此,本文的企业 VPN 示例明确设置 false,隐私 VPN 示例明确设置 true;部署时应检查实际生效值,不把原指南的简述当作所有发行版的无条件默认。
匹配最长后缀;相同长度可能并行查询
如果同一名称与多个接口的规则匹配,systemd-resolved 优先选择匹配后缀最长的接口。例如,一个接口配置 ~foo.example.com,另一个配置 example.com,查询 waldo.foo.example.com 时,前者的匹配更具体,因此只有前者接收查询。
只有最佳匹配的长度相同,查询才会并行发送到多个匹配接口。解析器采用首先返回的正向结果;如果全部失败,采用最后返回的否定结果。这样,不同接口上的 DNS 区域可以在一定程度上“合并”,但也意味着同一查询可能被多个网络看到。配置隐私相关规则时,不应忽略这一点。
同样,~corp.company.example 比 ~. 更具体。因此即便隐私 VPN 配置了根路由域,公司内部名称仍会进入公司 VPN。这里的公司后缀有三个标签;原文相关说明将其写成四个,本文按实际域名结构更正,最长后缀优先的结论不变。
把三种接口组合起来
| 接口 | 域设置 | default-route | 目的 |
|---|---|---|---|
company0 |
~corp.company.example;按需加 ~2.0.192.in-addr.arpa |
false |
只解析公司域及示例地址段 192.0.2.x 的反查 |
privacy0 |
~. |
此场景下不影响根域匹配;可明确设为 true |
接收没有更具体规则的查询 |
wifi0 |
保留可信网络提供的域,例如 fritz.box |
true |
解析本地域,并在隐私 VPN 断开后接收普通查询 |
只连接 wifi0 时,没有更合适的接口,DNS 查询由 Wi-Fi 上的服务器处理。连接 privacy0 后,普通查询转入隐私 VPN,但 fritz.box 下的名称仍由 Wi-Fi 解析,因为本地域规则更具体。再连接 company0,公司域和公司地址段的反查会转给企业 VPN,其余规则不变。断开隐私 VPN 后,普通查询回到 Wi-Fi,公司相关查询仍由企业 VPN 处理。
这也揭示了一个容易误判的地方:~. 的含义是兜底匹配,不是覆盖所有本地域。若隐私目标要求任何 DNS 都不能发到不可信 Wi-Fi,就需要审视该网络提供的搜索域和路由域,必要时抑制安装这些规则,并用独立的网络策略约束实际流量。
VPN 软件怎样提交配置
VPN 软件可以把“企业用途”和“隐私用途”作为清楚的连接选项。企业连接配置服务器或用户给出的公司域,关闭 default-route,有地址范围信息时再增加 IPv4、IPv6 的反查路由域;隐私连接增加 ~.,无需另列所有反查域。普通 Wi-Fi 或以太网接口则按其正常租约配置,通常无需添加 ~.,也不应无故关闭 DNS 默认路由。
首选接口是 D-Bus。访问对象 /org/freedesktop/resolve1 上的 org.freedesktop.resolve1.Manager,使用 SetLinkDomains() 设置接口的搜索域与路由域,用 SetLinkDefaultRoute() 设置 DNS 默认路由。完整接口定义见 systemd-resolved D-Bus 文档。
如果 VPN 软件只能运行外部命令,可使用 D-Bus 的薄封装 resolvectl。下面保留原文的配置顺序,但把企业接口名和公司域统一为前文的 company0 与 corp.company.example;这是对原文示例命名不一致的编辑性修改。
# 示例企业接口;域名、接口和服务器地址均需替换为实际配置
resolvectl domain company0 '~corp.company.example' '~2.0.192.in-addr.arpa'
resolvectl default-route company0 false
resolvectl dns company0 192.0.2.1
# 原文的隐私 VPN 演示;8.8.8.8 只是示例 DNS 地址
resolvectl domain privacy0 '~.'
resolvectl default-route privacy0 true
resolvectl dns privacy0 8.8.8.8
这些命令会修改系统的接口 DNS 配置,需要相应权限。192.0.2.1 是文档示例地址;8.8.8.8 也不意味着与任何 VPN 供应商存在配套关系。实际 DNS 服务器必须能够经目标隧道到达,并符合组织的解析和信任策略。将某个地址交给 resolvectl,不会自动安装通往它的 IP 路由。
第三种接入方式是 resolvconf 兼容封装。resolvectl 是可按调用名称切换行为的多调用二进制文件,以 resolvconf 名称调用时,提供与 FreeBSD、Ubuntu/Debian 工具大体兼容的接口。其 -x 选项会自动加入 ~.,适合隐私 VPN。此接口不能传递 default-route,也不能充分表达这里需要的仅路由反查域,因此不能完整覆盖企业 VPN 的配置需求。
配置顺序决定过渡期行为
应尽可能在真正启用接口之前完成接口 DNS 配置。接口一旦启用,systemd-resolved 就可能开始使用它;启用 LLMNR 或 MulticastDNS 时,这一点尤其重要,因为这两类解析不需要显式配置单播 DNS 服务器也能工作。
同一接口内,应先设置搜索域、路由域及 default-route,最后再设置 DNS 服务器。只有域规则而没有服务器,不会开始向该服务器发送查询;反过来先填服务器、稍后再补规则,就可能在过渡期把不应发送的名称交给它。把以上命令接入 VPN 生命周期时,还应检查每一步的返回状态,失败后不能继续把不完整配置当作已完成。
为什么要把搜索域降为仅路由域
短名称往往携带“就在当前本地网络”的含义。原文举例说,用户平时访问 printer,以为它是家里的 printer.home;连接公司 VPN 后,新加入的搜索域 foocorp.example 却可能让它指向 printer.foocorp.example。这样,用户本以为交给家中打印机的保密文档,可能交到了远端设备。
如果 VPN 客户端把服务器提供的搜索域改为 ~foocorp.example,完整公司域仍能正确选路,却不会通过追加公司后缀改变单标签名称的解析上下文。面对不可信 Wi-Fi,原文还建议考虑完全不安装其搜索域与路由域,只在没有更合适的 DNS 配置时使用该网络的解析信息。
静态审查与使用边界
本文只阅读并静态核对了源文和命令,没有改变主机 DNS、建立 VPN、运行网络命令或测量 DNS 泄漏。示例不含密码或令牌。主要风险是命令选错接口、沿用示例地址、先配置服务器产生短暂误路由,以及把不可信输入拼接成 shell 命令;集成程序应优先调用 D-Bus,或用参数数组启动进程并验证接口、域名和地址,避免把 VPN 服务器输入当作 shell 代码。没有发现硬编码秘密不等于整个 VPN 实现没有漏洞。
发布后部署仍需按目标发行版核对服务是否启用、应用是否使用系统解析器、网络管理器是否会覆盖设置,以及 VPN 断开后的回退行为。本文的示意和配置逻辑不是这些环境检查的替代品。
原文:systemd-resolved.service and VPNs。原文源码与 SPDX 声明:RESOLVED-VPNS.md。© systemd 及贡献者;原文及本文译编保留 LGPL-2.1-or-later 条款,无担保。本文于 2026 年 10 月 5 日作中文译编,统一示例命名、修正标签数量并增加版本与静态审查注。不改变原有权利归属。
保留的完整许可声明
以下为原项目适用许可文本,原作者与文档归属及本文改动说明见正文。
GNU LESSER GENERAL PUBLIC LICENSE
Version 2.1, February 1999
Copyright (C) 1991, 1999 Free Software Foundation, Inc.
59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
Everyone is permitted to copy and distribute verbatim copies
of this license document, but changing it is not allowed.
[This is the first released version of the Lesser GPL. It also counts
as the successor of the GNU Library Public License, version 2, hence
the version number 2.1.]
Preamble
The licenses for most software are designed to take away your
freedom to share and change it. By contrast, the GNU General Public
Licenses are intended to guarantee your freedom to share and change
free software--to make sure the software is free for all its users.
This license, the Lesser General Public License, applies to some
specially designated software packages--typically libraries--of the
Free Software Foundation and other authors who decide to use it. You
can use it too, but we suggest you first think carefully about whether
this license or the ordinary General Public License is the better
strategy to use in any particular case, based on the explanations below.
When we speak of free software, we are referring to freedom of use,
not price. Our General Public Licenses are designed to make sure that
you have the freedom to distribute copies of free software (and charge
for this service if you wish); that you receive source code or can get
it if you want it; that you can change the software and use pieces of
it in new free programs; and that you are informed that you can do
these things.
To protect your rights, we need to make restrictions that forbid
distributors to deny you these rights or to ask you to surrender these
rights. These restrictions translate to certain responsibilities for
you if you distribute copies of the library or if you modify it.
For example, if you distribute copies of the library, whether gratis
or for a fee, you must give the recipients all the rights that we gave
you. You must make sure that they, too, receive or can get the source
code. If you link other code with the library, you must provide
complete object files to the recipients, so that they can relink them
with the library after making changes to the library and recompiling
it. And you must show them these terms so they know their rights.
We protect your rights with a two-step method: (1) we copyright the
library, and (2) we offer you this license, which gives you legal
permission to copy, distribute and/or modify the library.
To protect each distributor, we want to make it very clear that
there is no warranty for the free library. Also, if the library is
modified by someone else and passed on, the recipients should know
that what they have is not the original version, so that the original
author's reputation will not be affected by problems that might be
introduced by others.
Finally, software patents pose a constant threat to the existence of
any free program. We wish to make sure that a company cannot
effectively restrict the users of a free program by obtaining a
restrictive license from a patent holder. Therefore, we insist that
any patent license obtained for a version of the library must be
consistent with the full freedom of use specified in this license.
Most GNU software, including some libraries, is covered by the
ordinary GNU General Public License. This license, the GNU Lesser
General Public License, applies to certain designated libraries, and
is quite different from the ordinary General Public License. We use
this license for certain libraries in order to permit linking those
libraries into non-free programs.
When a program is linked with a library, whether statically or using
a shared library, the combination of the two is legally speaking a
combined work, a derivative of the original library. The ordinary
General Public License therefore permits such linking only if the
entire combination fits its criteria of freedom. The Lesser General
Public License permits more lax criteria for linking other code with
the library.
We call this license the "Lesser" General Public License because it
does Less to protect the user's freedom than the ordinary General
Public License. It also provides other free software developers Less
of an advantage over competing non-free programs. These disadvantages
are the reason we use the ordinary General Public License for many
libraries. However, the Lesser license provides advantages in certain
special circumstances.
For example, on rare occasions, there may be a special need to
encourage the widest possible use of a certain library, so that it becomes
a de-facto standard. To achieve this, non-free programs must be
allowed to use the library. A more frequent case is that a free
library does the same job as widely used non-free libraries. In this
case, there is little to gain by limiting the free library to free
software only, so we use the Lesser General Public License.
In other cases, permission to use a particular library in non-free
programs enables a greater number of people to use a large body of
free software. For example, permission to use the GNU C Library in
non-free programs enables many more people to use the whole GNU
operating system, as well as its variant, the GNU/Linux operating
system.
Although the Lesser General Public License is Less protective of the
users' freedom, it does ensure that the user of a program that is
linked with the Library has the freedom and the wherewithal to run
that program using a modified version of the Library.
The precise terms and conditions for copying, distribution and
modification follow. Pay close attention to the difference between a
"work based on the library" and a "work that uses the library". The
former contains code derived from the library, whereas the latter must
be combined with the library in order to run.
GNU LESSER GENERAL PUBLIC LICENSE
TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
0. This License Agreement applies to any software library or other
program which contains a notice placed by the copyright holder or
other authorized party saying it may be distributed under the terms of
this Lesser General Public License (also called "this License").
Each licensee is addressed as "you".
A "library" means a collection of software functions and/or data
prepared so as to be conveniently linked with application programs
(which use some of those functions and data) to form executables.
The "Library", below, refers to any such software library or work
which has been distributed under these terms. A "work based on the
Library" means either the Library or any derivative work under
copyright law: that is to say, a work containing the Library or a
portion of it, either verbatim or with modifications and/or translated
straightforwardly into another language. (Hereinafter, translation is
included without limitation in the term "modification".)
"Source code" for a work means the preferred form of the work for
making modifications to it. For a library, complete source code means
all the source code for all modules it contains, plus any associated
interface definition files, plus the scripts used to control compilation
and installation of the library.
Activities other than copying, distribution and modification are not
covered by this License; they are outside its scope. The act of
running a program using the Library is not restricted, and output from
such a program is covered only if its contents constitute a work based
on the Library (independent of the use of the Library in a tool for
writing it). Whether that is true depends on what the Library does
and what the program that uses the Library does.
1. You may copy and distribute verbatim copies of the Library's
complete source code as you receive it, in any medium, provided that
you conspicuously and appropriately publish on each copy an
appropriate copyright notice and disclaimer of warranty; keep intact
all the notices that refer to this License and to the absence of any
warranty; and distribute a copy of this License along with the
Library.
You may charge a fee for the physical act of transferring a copy,
and you may at your option offer warranty protection in exchange for a
fee.
2. You may modify your copy or copies of the Library or any portion
of it, thus forming a work based on the Library, and copy and
distribute such modifications or work under the terms of Section 1
above, provided that you also meet all of these conditions:
a) The modified work must itself be a software library.
b) You must cause the files modified to carry prominent notices
stating that you changed the files and the date of any change.
c) You must cause the whole of the work to be licensed at no
charge to all third parties under the terms of this License.
d) If a facility in the modified Library refers to a function or a
table of data to be supplied by an application program that uses
the facility, other than as an argument passed when the facility
is invoked, then you must make a good faith effort to ensure that,
in the event an application does not supply such function or
table, the facility still operates, and performs whatever part of
its purpose remains meaningful.
(For example, a function in a library to compute square roots has
a purpose that is entirely well-defined independent of the
application. Therefore, Subsection 2d requires that any
application-supplied function or table used by this function must
be optional: if the application does not supply it, the square
root function must still compute square roots.)
These requirements apply to the modified work as a whole. If
identifiable sections of that work are not derived from the Library,
and can be reasonably considered independent and separate works in
themselves, then this License, and its terms, do not apply to those
sections when you distribute them as separate works. But when you
distribute the same sections as part of a whole which is a work based
on the Library, the distribution of the whole must be on the terms of
this License, whose permissions for other licensees extend to the
entire whole, and thus to each and every part regardless of who wrote
it.
Thus, it is not the intent of this section to claim rights or contest
your rights to work written entirely by you; rather, the intent is to
exercise the right to control the distribution of derivative or
collective works based on the Library.
In addition, mere aggregation of another work not based on the Library
with the Library (or with a work based on the Library) on a volume of
a storage or distribution medium does not bring the other work under
the scope of this License.
3. You may opt to apply the terms of the ordinary GNU General Public
License instead of this License to a given copy of the Library. To do
this, you must alter all the notices that refer to this License, so
that they refer to the ordinary GNU General Public License, version 2,
instead of to this License. (If a newer version than version 2 of the
ordinary GNU General Public License has appeared, then you can specify
that version instead if you wish.) Do not make any other change in
these notices.
Once this change is made in a given copy, it is irreversible for
that copy, so the ordinary GNU General Public License applies to all
subsequent copies and derivative works made from that copy.
This option is useful when you wish to copy part of the code of
the Library into a program that is not a library.
4. You may copy and distribute the Library (or a portion or
derivative of it, under Section 2) in object code or executable form
under the terms of Sections 1 and 2 above provided that you accompany
it with the complete corresponding machine-readable source code, which
must be distributed under the terms of Sections 1 and 2 above on a
medium customarily used for software interchange.
If distribution of object code is made by offering access to copy
from a designated place, then offering equivalent access to copy the
source code from the same place satisfies the requirement to
distribute the source code, even though third parties are not
compelled to copy the source along with the object code.
5. A program that contains no derivative of any portion of the
Library, but is designed to work with the Library by being compiled or
linked with it, is called a "work that uses the Library". Such a
work, in isolation, is not a derivative work of the Library, and
therefore falls outside the scope of this License.
However, linking a "work that uses the Library" with the Library
creates an executable that is a derivative of the Library (because it
contains portions of the Library), rather than a "work that uses the
library". The executable is therefore covered by this License.
Section 6 states terms for distribution of such executables.
When a "work that uses the Library" uses material from a header file
that is part of the Library, the object code for the work may be a
derivative work of the Library even though the source code is not.
Whether this is true is especially significant if the work can be
linked without the Library, or if the work is itself a library. The
threshold for this to be true is not precisely defined by law.
If such an object file uses only numerical parameters, data
structure layouts and accessors, and small macros and small inline
functions (ten lines or less in length), then the use of the object
file is unrestricted, regardless of whether it is legally a derivative
work. (Executables containing this object code plus portions of the
Library will still fall under Section 6.)
Otherwise, if the work is a derivative of the Library, you may
distribute the object code for the work under the terms of Section 6.
Any executables containing that work also fall under Section 6,
whether or not they are linked directly with the Library itself.
6. As an exception to the Sections above, you may also combine or
link a "work that uses the Library" with the Library to produce a
work containing portions of the Library, and distribute that work
under terms of your choice, provided that the terms permit
modification of the work for the customer's own use and reverse
engineering for debugging such modifications.
You must give prominent notice with each copy of the work that the
Library is used in it and that the Library and its use are covered by
this License. You must supply a copy of this License. If the work
during execution displays copyright notices, you must include the
copyright notice for the Library among them, as well as a reference
directing the user to the copy of this License. Also, you must do one
of these things:
a) Accompany the work with the complete corresponding
machine-readable source code for the Library including whatever
changes were used in the work (which must be distributed under
Sections 1 and 2 above); and, if the work is an executable linked
with the Library, with the complete machine-readable "work that
uses the Library", as object code and/or source code, so that the
user can modify the Library and then relink to produce a modified
executable containing the modified Library. (It is understood
that the user who changes the contents of definitions files in the
Library will not necessarily be able to recompile the application
to use the modified definitions.)
b) Use a suitable shared library mechanism for linking with the
Library. A suitable mechanism is one that (1) uses at run time a
copy of the library already present on the user's computer system,
rather than copying library functions into the executable, and (2)
will operate properly with a modified version of the library, if
the user installs one, as long as the modified version is
interface-compatible with the version that the work was made with.
c) Accompany the work with a written offer, valid for at
least three years, to give the same user the materials
specified in Subsection 6a, above, for a charge no more
than the cost of performing this distribution.
d) If distribution of the work is made by offering access to copy
from a designated place, offer equivalent access to copy the above
specified materials from the same place.
e) Verify that the user has already received a copy of these
materials or that you have already sent this user a copy.
For an executable, the required form of the "work that uses the
Library" must include any data and utility programs needed for
reproducing the executable from it. However, as a special exception,
the materials to be distributed need not include anything that is
normally distributed (in either source or binary form) with the major
components (compiler, kernel, and so on) of the operating system on
which the executable runs, unless that component itself accompanies
the executable.
It may happen that this requirement contradicts the license
restrictions of other proprietary libraries that do not normally
accompany the operating system. Such a contradiction means you cannot
use both them and the Library together in an executable that you
distribute.
7. You may place library facilities that are a work based on the
Library side-by-side in a single library together with other library
facilities not covered by this License, and distribute such a combined
library, provided that the separate distribution of the work based on
the Library and of the other library facilities is otherwise
permitted, and provided that you do these two things:
a) Accompany the combined library with a copy of the same work
based on the Library, uncombined with any other library
facilities. This must be distributed under the terms of the
Sections above.
b) Give prominent notice with the combined library of the fact
that part of it is a work based on the Library, and explaining
where to find the accompanying uncombined form of the same work.
8. You may not copy, modify, sublicense, link with, or distribute
the Library except as expressly provided under this License. Any
attempt otherwise to copy, modify, sublicense, link with, or
distribute the Library is void, and will automatically terminate your
rights under this License. However, parties who have received copies,
or rights, from you under this License will not have their licenses
terminated so long as such parties remain in full compliance.
9. You are not required to accept this License, since you have not
signed it. However, nothing else grants you permission to modify or
distribute the Library or its derivative works. These actions are
prohibited by law if you do not accept this License. Therefore, by
modifying or distributing the Library (or any work based on the
Library), you indicate your acceptance of this License to do so, and
all its terms and conditions for copying, distributing or modifying
the Library or works based on it.
10. Each time you redistribute the Library (or any work based on the
Library), the recipient automatically receives a license from the
original licensor to copy, distribute, link with or modify the Library
subject to these terms and conditions. You may not impose any further
restrictions on the recipients' exercise of the rights granted herein.
You are not responsible for enforcing compliance by third parties with
this License.
11. If, as a consequence of a court judgment or allegation of patent
infringement or for any other reason (not limited to patent issues),
conditions are imposed on you (whether by court order, agreement or
otherwise) that contradict the conditions of this License, they do not
excuse you from the conditions of this License. If you cannot
distribute so as to satisfy simultaneously your obligations under this
License and any other pertinent obligations, then as a consequence you
may not distribute the Library at all. For example, if a patent
license would not permit royalty-free redistribution of the Library by
all those who receive copies directly or indirectly through you, then
the only way you could satisfy both it and this License would be to
refrain entirely from distribution of the Library.
If any portion of this section is held invalid or unenforceable under any
particular circumstance, the balance of the section is intended to apply,
and the section as a whole is intended to apply in other circumstances.
It is not the purpose of this section to induce you to infringe any
patents or other property right claims or to contest validity of any
such claims; this section has the sole purpose of protecting the
integrity of the free software distribution system which is
implemented by public license practices. Many people have made
generous contributions to the wide range of software distributed
through that system in reliance on consistent application of that
system; it is up to the author/donor to decide if he or she is willing
to distribute software through any other system and a licensee cannot
impose that choice.
This section is intended to make thoroughly clear what is believed to
be a consequence of the rest of this License.
12. If the distribution and/or use of the Library is restricted in
certain countries either by patents or by copyrighted interfaces, the
original copyright holder who places the Library under this License may add
an explicit geographical distribution limitation excluding those countries,
so that distribution is permitted only in or among countries not thus
excluded. In such case, this License incorporates the limitation as if
written in the body of this License.
13. The Free Software Foundation may publish revised and/or new
versions of the Lesser General Public License from time to time.
Such new versions will be similar in spirit to the present version,
but may differ in detail to address new problems or concerns.
Each version is given a distinguishing version number. If the Library
specifies a version number of this License which applies to it and
"any later version", you have the option of following the terms and
conditions either of that version or of any later version published by
the Free Software Foundation. If the Library does not specify a
license version number, you may choose any version ever published by
the Free Software Foundation.
14. If you wish to incorporate parts of the Library into other free
programs whose distribution conditions are incompatible with these,
write to the author to ask for permission. For software which is
copyrighted by the Free Software Foundation, write to the Free
Software Foundation; we sometimes make exceptions for this. Our
decision will be guided by the two goals of preserving the free status
of all derivatives of our free software and of promoting the sharing
and reuse of software generally.
NO WARRANTY
15. BECAUSE THE LIBRARY IS LICENSED FREE OF CHARGE, THERE IS NO
WARRANTY FOR THE LIBRARY, TO THE EXTENT PERMITTED BY APPLICABLE LAW.
EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR
OTHER PARTIES PROVIDE THE LIBRARY "AS IS" WITHOUT WARRANTY OF ANY
KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE
LIBRARY IS WITH YOU. SHOULD THE LIBRARY PROVE DEFECTIVE, YOU ASSUME
THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
16. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN
WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY
AND/OR REDISTRIBUTE THE LIBRARY AS PERMITTED ABOVE, BE LIABLE TO YOU
FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR
CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE
LIBRARY (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING
RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A
FAILURE OF THE LIBRARY TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF
SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH
DAMAGES.
END OF TERMS AND CONDITIONS
How to Apply These Terms to Your New Libraries
If you develop a new library, and you want it to be of the greatest
possible use to the public, we recommend making it free software that
everyone can redistribute and change. You can do so by permitting
redistribution under these terms (or, alternatively, under the terms of the
ordinary General Public License).
To apply these terms, attach the following notices to the library. It is
safest to attach them to the start of each source file to most effectively
convey the exclusion of warranty; and each file should have at least the
"copyright" line and a pointer to where the full notice is found.
<one line to give the library's name and a brief idea of what it does.>
Copyright (C) <year> <name of author>
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2.1 of the License, or (at your option) any later version.
This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public
License along with this library; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
Also add information on how to contact you by electronic and paper mail.
You should also get your employer (if you work as a programmer) or your
school, if any, to sign a "copyright disclaimer" for the library, if
necessary. Here is a sample; alter the names:
Yoyodyne, Inc., hereby disclaims all copyright interest in the
library `Frob' (a library for tweaking knobs) written by James Random Hacker.
<signature of Ty Coon>, 1 April 1990
Ty Coon, President of Vice
That's all there is to it!












暂无评论内容