우분투의 DHCP 서버에서 DNS 무시


16

파일에 정적 DNS을 설정 했습니다 /etc/resolvconf/resolv.conf.d/base.

nameserver 8.8.8.8
nameserver 8.8.4.4

그러나 내 PC는 여전히 DHCP에서 DNS를 얻습니다 /etc/resolv.conf.

nameserver 192.168.100.2 
nameserver 8.8.8.8
nameserver 8.8.4.4

서버 DNS에서 얻은 것을 무시하는 방법 DHCP?

답변:


28

이 줄을 다음에 추가 할 수 있습니다 /etc/dhcp/dhclient.conf.

supersede domain-name-servers 8.8.8.8, 8.8.4.4;

그런 다음 네트워크를 다시 시작하거나 실행 dhclient하여 변경하십시오.

보낸 사람 man dhclient.conf:

The supersede statement

       supersede [ option declaration ];

       If for some option the client should always  use  a  locally-configured
       value  or  values rather than whatever is supplied by the server, these
       values can be defined in the supersede statement.

4
또한 요청하지 않으려 /etc/dhcp/dhclient.confrequest매개 변수 에서 주석을 달 수 있습니다 domain-name, domain-name-servers, domain-search. DNS의 경우 수 있습니다 .
Alex

@Alex 일부 장치는 요청하지 않은 옵션으로 응답합니다. 요청하지 않으면 무시 될 것이라고 생각하지만 실제로 반대의 경우가 나타납니다. ... 보안에 민감한 장치를 구성 할 때 뭔가 기억 (예 : 전송 CIDR 경로를 게이트웨이에서 트래픽을 무시합니다.)
gertvdijk
당사 사이트를 사용함과 동시에 당사의 쿠키 정책개인정보 보호정책을 읽고 이해하였음을 인정하는 것으로 간주합니다.
Licensed under cc by-sa 3.0 with attribution required.