Solved Hostname resolution

Am I correct in thinking that hostname resolution is set by running dhclient ixx and this updates /etc/resolv.conf?

What do I do if I want to set my own nameserver to something like 1.1.1.1 ?
 
Am I correct in thinking that hostname resolution is set by running dhclient ixx and this updates /etc/resolv.conf?
DHCP can supply DNS servers, yes.

What do I do if I want to set my own nameserver to something like 1.1.1.1 ?
Either change it on the DHCP server (but this would apply to all), or use dhclient.conf(5) supersede, prepend or append:
Code:
     supersede { [option declaration] [, ... option declaration] }
             If for some set of options the client should always use its own
             value rather than any value supplied by the server, these values
             can be defined in the supersede statement.

             Some options values have special meaning:

             interface-mtu
                     Any server-supplied interface MTU is ignored by the
                     client if a supersede zero value is configured.

     prepend { [option declaration] [, ... option declaration] }
             If for some set of options the client should use a value you
             supply, and then use the values supplied by the server, if any,
             these values can be defined in the prepend statement.  The
             prepend statement can only be used for options which allow more
             than one value to be given.  This restriction is not enforced -
             if violated, the results are unpredictable.

     append { [option declaration] [, ... option declaration] }
             If for some set of options the client should first use the values
             supplied by the server, if any, and then use values you supply,
             these values can be defined in the append statement.  The append
             statement can only be used for options which allow more than one
             value to be given.  This restriction is not enforced - if you
             ignore it, the behaviour will be unpredictable.
 
To be honest I thought it had something to do with isc-dhcpcd.

I'm not sure that I understand what is requred, but will something like this be suffcient to set the nameserver to 1.1.1.1 ?


Code:
interface "em0" {
         prepend domain-name-servers 1.1.1.1;
         }
 
To be honest I thought it had something to do with isc-dscpcd.

I'm not sure that I understand what is requred, but will something like this be suffcient to set the nameserver to 1.1.1.1 ?


Code:
interface "em0" {
         prepend domain-name-servers 1.1.1.1;
         }
That looks about right to me.
 
did you put ue0 in your config or em0? If the tethering is on ue0 that's what you need to put in the config file.
dhclient should force renewal
 
I used ue0. em0 is static.

I wasn't sure if dhclient did anything if there was an existing lease so I deleted the lease file. But the new lease did not provide the required name server.

Looks like I'm missing something.
 
After some trial and error I got it to work using this:

Code:
interface "ue0" {
         supercede domain-name-servers 1.1.1.1;
         }
 
Back
Top