Static IP address without removing DHCP

Dotan Cohen dotancohen at gmail.com
Sun Oct 26 12:56:28 UTC 2014


Yes, I just checked on one of the Windows machines here and I see that
it is using 10.0.0.138 for DNS, so I see that it is safe to use. The
lines should just simple be this?

auto eth0
    iface eth0 inet static
    address 10.0.0.7
    netmask 255.255.255.0
    gateway 10.0.0.138
    dns-nameservers 10.0.0.138
    dns-search 10.0.0.138

Thank you Douglas!


On Sun, Oct 26, 2014 at 2:54 PM, Douglas Stanley
<douglas.m.stanley at gmail.com> wrote:
>
> On Oct 26, 2014 8:49 AM, "Dotan Cohen" <dotancohen at gmail.com> wrote:
>>
>> On Sun, Oct 26, 2014 at 2:41 PM, Douglas Stanley
>> <douglas.m.stanley at gmail.com> wrote:
>> > Don't forget to add the options:
>> >
>> > dns-nameservers
>> > dns-search
>> >
>> > Otherwise you may not be able to resolve DNS.
>> >
>> > Doug
>>
>>
>> Thank you! For some reason I seem to be using a loopback, but I don't
>> see where the configuration outside is handled:
>>
>> $ cat /etc/resolv.conf
>> # Dynamic resolv.conf(5) file for glibc resolver(3) generated by
>> resolvconf(8)
>> #     DO NOT EDIT THIS FILE BY HAND -- YOUR CHANGES WILL BE OVERWRITTEN
>> nameserver 127.0.1.1
>> search Home
>>
>> $ dig gmail.com
>>
>> ; <<>> DiG 9.9.5-3-Ubuntu <<>> gmail.com
>> ;; global options: +cmd
>> ;; Got answer:
>> ;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 22197
>> ;; flags: qr rd ra; QUERY: 1, ANSWER: 2, AUTHORITY: 0, ADDITIONAL: 0
>>
>> ;; QUESTION SECTION:
>> ;gmail.com.                     IN      A
>>
>> ;; ANSWER SECTION:
>> gmail.com.              181     IN      A       173.194.113.85
>> gmail.com.              181     IN      A       173.194.113.86
>>
>> ;; Query time: 62 msec
>> ;; SERVER: 127.0.1.1#53(127.0.1.1)
>> ;; WHEN: Sun Oct 26 14:45:49 IST 2014
>> ;; MSG SIZE  rcvd: 59
>>
>>
>> Perhaps I am running a DNS server locally? I don't remember doing that
>> but it is possible that I just forgot. I do see that I'm listening on
>> port 53:
>>
>> $ netstat -ntulp | grep 53
>> tcp        0      0 127.0.1.1:53            0.0.0.0:*
>> LISTEN      -
>> udp        0      0 127.0.1.1:53            0.0.0.0:*
>>          -
>> udp        0      0 0.0.0.0:5353            0.0.0.0:*
>>          -
>> udp6       0      0 :::5353                 :::*
>>          -
>>
>>
>>
>> How should I go about diagnosing this? I would have assumed that my
>> DNS would point to the same address as the default gateway as the
>> router does do DNS.
>>
> Yes, so the default uses a local DNS server and puts your upstream DNS
> server in the local DNS servers config. Does that make sense? I don't
> remember where you can find what actual DNS server you got from dhcp, but if
> you know the gateway does DNS resolving, just use that IP.
>
> Doug
>
>> --
>> Dotan Cohen
>>
>> http://gibberish.co.il
>> http://what-is-what.com



-- 
Dotan Cohen

http://gibberish.co.il
http://what-is-what.com




More information about the ubuntu-server mailing list