PDA

View Full Version : [XP1000] Change nameservers but keep DHCP



FireballXL5
14-01-14, 13:40
I want to define my own DNS servers but I want to keep using DHCP to get an IP address but the system won't keep the settings I enter manually for after restarting the network or rebooting my box it defaults back to using my routers IP address. Is there anyway I can manually set my DNS servers, perhaps by manually editing a filea and keep DHCP?
Thanks.

sebus
14-01-14, 20:36
Edit /etc/resolv.cfg

sebus

Tkr001
14-01-14, 21:24
Specify your DNS in the router

FireballXL5
15-01-14, 11:47
Edit /etc/resolv.cfg

sebus

Thanks for the tip but it doesn't work. If I set DHCP to Yes and manually add the nameservers (either through the user interface or by editing resolve.cfg) the system changes the nameservers back to my router address after a restart. I want to have the router maintain the dynamic IP address whilst fixing out the nameservers.

The option of changing the nameserver values in the router isn't available.

Any idea if this can be done?

sebus
15-01-14, 20:56
Here is your solution:

http://forum.tinycorelinux.net/index.php?topic=8019

and linked to it from that page:

http://git.busybox.net/busybox/tree/examples/udhcp

Ofcourse ignore steps 3 & 4 as they are specific to TinyCore only

sebus

FireballXL5
16-01-14, 10:46
Here is your solution:

http://forum.tinycorelinux.net/index.php?topic=8019

and linked to it from that page:

http://git.busybox.net/busybox/tree/examples/udhcp

Ofcourse ignore steps 3 & 4 as they are specific to TinyCore only

sebus

Nice one sebus, thanks for this, much appreciated :)

Bangord30
25-08-17, 19:09
Here is your solution:

http://forum.tinycorelinux.net/index.php?topic=8019

and linked to it from that page:

http://git.busybox.net/busybox/tree/examples/udhcp

Ofcourse ignore steps 3 & 4 as they are specific to TinyCore only

sebusIs this still necessary guys to get a dns change to stick on the box?

Sent from my HUAWEI VNS-L31 using Tapatalk

birdman
26-08-17, 00:46
Difficult to see how the suggestion of setting dns=.... in /usr/share/udhcpc/default.script can do anything useful as all it does is set a local variable, which is then ignored by any sub-process.
Looks like you'd actually need to edit the /etc/udhcpc.d/50default file instead.

And you haven't said why you want to use a different DNS resolver to the oner that your DHCP server is setting. It would be simpler to just change that (and presumably better, as all DHCP devices would then get the resolver you wish to use).