Hello Guest, if you are reading this it means you have not registered yet. Please take a second, Click here to register, and in a few simple steps you will be able to enjoy our community and use our OpenViX support section.
Results 1 to 8 of 8

Thread: Change nameservers but keep DHCP

  1. #1
    FireballXL5's Avatar
    Title
    Forum Supporter
    Donated Member
    Join Date
    Feb 2013
    Posts
    23
    Thanks
    6
    Thanked 0 Times in 0 Posts

    Change nameservers but keep DHCP

    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.

  2. #2

    Title
    Member
    Join Date
    Jan 2013
    Location
    Island on the edge of Europe
    Posts
    64
    Thanks
    13
    Thanked 5 Times in 3 Posts
    Edit /etc/resolv.cfg

    sebus

  3. #3

    Title
    Forum Supporter
    Donated Member
    Join Date
    Aug 2010
    Location
    Auckland, New Zealand
    Posts
    787
    Thanks
    86
    Thanked 151 Times in 124 Posts
    Specify your DNS in the router

  4. #4
    FireballXL5's Avatar
    Title
    Forum Supporter
    Donated Member
    Join Date
    Feb 2013
    Posts
    23
    Thanks
    6
    Thanked 0 Times in 0 Posts
    Quote Originally Posted by sebus View Post
    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?

  5. #5

    Title
    Member
    Join Date
    Jan 2013
    Location
    Island on the edge of Europe
    Posts
    64
    Thanks
    13
    Thanked 5 Times in 3 Posts
    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

  6. The Following 2 Users Say Thank You to sebus For This Useful Post:

    Bangord30 (25-08-17),FireballXL5 (16-01-14)

  7. #6
    FireballXL5's Avatar
    Title
    Forum Supporter
    Donated Member
    Join Date
    Feb 2013
    Posts
    23
    Thanks
    6
    Thanked 0 Times in 0 Posts
    Quote Originally Posted by sebus View Post
    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

  8. #7

    Title
    Forum Supporter
    Donated Member
    Join Date
    Jan 2016
    Posts
    533
    Thanks
    2,093
    Thanked 113 Times in 103 Posts
    Quote Originally Posted by sebus View Post
    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
    Is this still necessary guys to get a dns change to stick on the box?

    Sent from my HUAWEI VNS-L31 using Tapatalk

  9. #8
    birdman's Avatar
    Title
    Moderator
    Join Date
    Sep 2014
    Location
    Hitchin, UK
    Posts
    7,799
    Thanks
    237
    Thanked 1,659 Times in 1,307 Posts
    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).
    Last edited by birdman; 26-08-17 at 00:50.
    MiracleBox Prem Twin HD - 2@DVB-T2 + Xtrend et8000 - 5(incl. 2 different USBs)@DVB-T2[terrestrial - UK Freeview HD, Sandy Heath] - LAN/USB-stick/HDD

  10. The Following User Says Thank You to birdman For This Useful Post:

    Bangord30 (26-08-17)

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
This website uses cookies
We use cookies to store session information to facilitate remembering your login information, to allow you to save website preferences, to personalise content and ads, to provide social media features and to analyse our traffic. We also share information about your use of our site with our social media, advertising and analytics partners.