Fixed IP address and resolv.conf problem

Ask a Question related to Ubuntu, Design and Development.

  1. #1

    Default Fixed IP address and resolv.conf problem

    Hello

    I'm probably doing something really daft here.

    I've just switched from using DHCP (ip provided by my router) to a
    static IP address 192.168.1.15

    (I did this so I could easily use my machine as a NIS and NFS server)

    I used the Gnome "network settings" tools to set my IP address, default
    gateway, DNS etc to point my broadband router 192.168.1.1

    Now some applications (such as apt-get) cannot resove URLs.
    Interestingly, if I add the following line to /etc/resolv.conf it
    temporarily works again, although I suspect this is not where I should
    be specifying this.

    nameserver 192.168.1.1

    However, as the comments in resolv.conf indicate, whenever I reboot OR I
    use pptp, the file /etc/resolv.conf gets overwritten.


    BELOW IS MY /etc/network/interfaces FILE which seems ok to me.


    # This file describes the network interfaces available on your system
    # and how to activate them. For more information, see interfaces(5).

    # The loopback network interface
    auto lo
    iface lo inet loopback
    address 127.0.0.1
    netmask 255.0.0.0

    # This is a list of hotpluggable network interfaces.
    # They will be activated automatically by the hotplug subsystem.
    mapping hotplug
    script grep
    map eth0

    # The primary network interface
    auto eth0
    iface eth0 inet static
    network 192.168.1.0
    broadcast 192.168.1.255
    address 192.168.1.15
    netmask 255.255.255.0
    gateway 192.168.1.1





    Nick Guest

  2. Similar Questions and Discussions

    1. Change MAC address of LAN card in rc.conf. How?
      Hi, I'm running 5.3 STABLE. I need to change the MAC address of my PC. I know it can be done like this: ifconfig rl0 ether...
    2. nameservers and resolv.conf(s): switching from charter cable to tds dsl
      It seems to me when you configured your internet connection you told it not to pull down the name servers for you. You must have a...
    3. nameservers and resolv.conf(s): switching from charter cable to tds dsl
      this afternoon I was looking through files on my system because when I added a new user, Pine wanted to give the user a chartermi.net domain even...
    4. nameservers and resolv.conf(s): switching from charter cable to tds dsl
      I am using tds dsl with a paradyne modem and dhcpcd. I have a cable from my ethernet card to the modem and from the modem to the phone jack. I use...
    5. resolv.conf
      I had a little trouble installing my ethernet cards drivers. Now the interface is up and works fine. But there is a problem with DNS....
  3. #2

    Default Re: Fixed IP address and resolv.conf problem

    On Wed, 17 May 2006 17:06:10 +0100, Nick wrote:
    > Now some applications (such as apt-get) cannot resove URLs.
    > Interestingly, if I add the following line to /etc/resolv.conf it
    > temporarily works again, although I suspect this is not where I should
    > be specifying this.
    > nameserver 192.168.1.1
    > However, as the comments in resolv.conf indicate, whenever I reboot OR I
    > use pptp, the file /etc/resolv.conf gets overwritten.
    and it should be like this
    make /etc/resolv.conf static file

    these services overwrite it:

    /etc/init.d/pppd-dns
    /etc/init.d/dns-clean

    so if you don't use DHCP anymore disable them
    or, if you don't know how or don't want to do it put in /etc/rc.local
    something like this:

    echo 'nameserver 192.168.1.1' >> /etc/resolv.conf

    it should do what you want to get

    --
    Pozdrawiam
    Zygfryd Homonto
    galeria: [url]http://photo.e-janik.com[/url]

    Zygfryd Homonto Guest

  4. #3

    Default Re: Fixed IP address and resolv.conf problem

    Zygfryd Homonto wrote:
    > On Wed, 17 May 2006 17:06:10 +0100, Nick wrote:
    >
    >
    >>Now some applications (such as apt-get) cannot resove URLs.
    >>Interestingly, if I add the following line to /etc/resolv.conf it
    >>temporarily works again, although I suspect this is not where I should
    >>be specifying this.
    >>nameserver 192.168.1.1
    >>However, as the comments in resolv.conf indicate, whenever I reboot OR I
    >>use pptp, the file /etc/resolv.conf gets overwritten.
    >
    >
    > and it should be like this
    > make /etc/resolv.conf static file
    >
    > these services overwrite it:
    >
    > /etc/init.d/pppd-dns
    > /etc/init.d/dns-clean
    >
    > so if you don't use DHCP anymore disable them
    > or, if you don't know how or don't want to do it put in /etc/rc.local
    > something like this:
    >
    > echo 'nameserver 192.168.1.1' >> /etc/resolv.conf
    >
    > it should do what you want to get
    >
    Thanks for the quick response.

    On question if I may. If I disable DHCP, will I get allocated an IP
    address when I use pptp (this is still dynamically allocated by the
    remote network)?

    By the way, I've been looking around and I've found an alternative
    solution. I edited /etc/resolvconf/resolv.conf.d/tail
    and I added the line
    nameserver 192.168.1.1

    Now, the resolv.conf file is automatically correct after a reboot and
    when I drop the pptp connection.
    Nick Guest

  5. #4

    Default Re: Fixed IP address and resolv.conf problem

    On Thu, 18 May 2006 15:37:15 +0100, Nick wrote:
    > On question if I may. If I disable DHCP, will I get allocated an IP
    > address when I use pptp (this is still dynamically allocated by the
    > remote network)?
    Most routers are able to map the MAC (ifconfig eth0 will tell you
    what it is) address in the DHCP so that your network card always gets the
    same IP address. I did this on my ipcop router a long time ago. Since I
    know my box always has 192.168.1.2 I can do port forwarding, etc...

    Or you could just do static IPs.
    Carbon Guest

Posting Permissions

  • You may not post new threads
  • You may post replies
  • You may not post attachments
  • You may not edit your posts

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139