[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: how to change default nameserver?



On Mon, Apr 10, 2023 at 12:05:06PM -0400, gene heskett wrote:
> Thanks for the vote of confidence Greg, but I'd like to point out that the
> help offered is only valid for systems with a working dhcpd.
> You tell me I'm wrong, but you don't tell how to do it right w/o dragging in
> dhcpd.  My way doesn't need that. But you've made it your lifes work to not
> understand how my way Just Works.

How To Set Up A Debian Computer With Static IP Addressing And Hosts File:

1) Install Debian.  Select "Standard".  Do not select a Desktop Environment.

2) Find the name of your ethernet interface, either using "ip link" or
   by reading /etc/network/interfaces.  For purposes of this document,
   let's say it's "en0".

3) Bring your ethernet interface down:  ifdown en0
   This will kill the DHCP client daemon.

4) Edit the /etc/network/interfaces file, and change
      iface en0 inet dhcp
   to
      iface en0 inet static
   and then add the "address" and "gateway" lines underneath that.
   While you're in there, make sure you have "auto en0" too.

5) Bring your interface up:  ifup en0

6) Verify that it works, by pinging your gateway, and then pinging an
   outside IP address (e.g. ping 8.8.8.8).

7) Edit your /etc/resolv.conf file correctly for your network.
   This means adding a "nameserver" line that points to your DNS resolver.
   Do not add lines that are not documented in resolv.conf(5).
   Specifically, do not add lines that mimic /etc/nsswitch.cong behavior
   in this file, because they do not work.

8) Verify that DNS works (e.g. ping www.debian.org).

9) Edit your /etc/hosts file to contain the IP addresses and names of
   other hosts on your internal network.

10) Verify that your internet network name resolution works
    (e.g. ping coyote).

There you go.  That's the whole thing.  That's what we've tried to tell
you to do, for the last 5 to 10 years.

I promise you, Gene, "search hosts, nameserver" is NOT a working line in
an /etc/resolv.conf file.  It never has been.  It never will be.


Reply to: