ISC DHCP dhclient:DNSネームサーバーをIPv4およびIPv6アドレスに置き換える方法は?

ISC DHCP dhclient:DNSネームサーバーをIPv4およびIPv6アドレスに置き換える方法は?

私は自分の設定を使用してDHCPサーバーから取得したネームサーバー情報をtpに置き換えたいと思います。だから私は次のオプションを使います/etc/dhcp/dhclient.conf

supersede domain-name-servers 1.1.1.1, 2.2.2.2, 3.3.3.3;

すべてがうまくいきますが、IPv6アドレスを追加したいのですが、これはデュアルスタックサーバーです。次の文は機能しません(/etc/dhcp/dhclient.conf line 56: semicolon expected.システムログを入力してください)。

supersede domain-name-servers 1.1.1.1, 2.2.2.2, 3.3.3.3, ::1, 2000::BEEF, FURTHER_IPv6_ADDRESS;

supersede domain-name-servers私の質問は:のオプションにIPv6アドレスをどのように追加しますか/etc/dhcp/dhclient.conf

ベストアンサー1

背景

このエラーに埋もれた解決策が見つかりました。タイトルは次のとおりです。バグ 643890 - dhclient が ipv6 ネームサーバーの追加を拒否する

Jiri Popelka 2010-10-18 15:37:46 UTC

(In reply to comment #0)
> prepend domain-name-servers 2001:470:20::2 ;
correct is
prepend dhcp6.name-servers 2001:470:20::2;
(see dhcp-options(5) man page)
but it seems that dhclient is really ignoring it.

I'm trying to figure out what's wrong.

マニュアルページdhcp-optionsにも以下が表示されます。

   option dhcp6.name-servers ip6-address [, ip6-address ... ] ;

     The  name-servers  option  instructs  clients about locally available 
     recursive DNS servers.  It is easiest to describe this as the "nameserver"
     line in /etc/resolv.conf.

例を修正

そのため、クライアントでデュアルスタッキング(IPv4とIP6)を実行するために、次の行を追加しました。

$ cat /etc/dhcp/dhclient.conf
...
...
## Global section example
prepend domain-name-servers 192.168.7.14,192.168.7.85;
prepend dhcp6.name-servers 2602:6030:dd00:d807::1a11;

## Interface section example
interface "eth0" {
    prepend domain-name-servers 192.168.7.14,192.168.7.85;
    prepend dhcp6.name-servers 2602:6030:dd00:d807::1a11;
}
...
...

おすすめ記事