Debian Stretch won't resolve hostname, but IP works












0















I have configured Stretch networking for eth0 (it picked ens3), after setting:



GRUB_CMDLINE_LINUX="net.ifnames=0 biosdevname=0"
grub-mkconfig -o /boot/grub/grub.cfg
reboot


so now I have:



>: cat /etc/network/interfaces
source /etc/network/interfaces.d/*

# The loopback network interface
auto lo
iface lo inet loopback

# The primary network interface
allow-hotplug eth0
iface eth0 inet static
address 192.168.1.10/24
gateway 192.168.1.1
# dns-* options are implemented by the resolvconf package, if installed
dns-nameservers 8.8.8.8


which works, so:



>: ip a
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN group default qlen 1
link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
inet 127.0.0.1/8 scope host lo
valid_lft forever preferred_lft forever
inet6 ::1/128 scope host
valid_lft forever preferred_lft forever
2: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP group default qlen 1000
link/ether 52:54:00:0a:f7:bc brd ff:ff:ff:ff:ff:ff
inet 192.168.1.10/24 brd 192.168.1.255 scope global eth0
valid_lft forever preferred_lft forever
inet6 fe80::5054:ff:fe0a:f7bc/64 scope link
valid_lft forever preferred_lft forever


And I can ping google nameservers like:



>: ping 8.8.8.8
PING 8.8.8.8 (8.8.8.8) 56(84) bytes of data.
64 bytes from 8.8.8.8: icmp_seq=1 ttl=55 time=10.9 ms
64 bytes from 8.8.8.8: icmp_seq=2 ttl=55 time=10.9 ms


But not google itself, or any other domain. My hosts file looks like:



>: cat /etc/hosts
127.0.0.1 localhost
192.168.1.10 someserver.name.com someserver

# The following lines are desirable for IPv6 capable hosts
::1 localhost ip6-localhost ip6-loopback
ff02::1 ip6-allnodes
ff02::2 ip6-allrouters


My resolv.conf looks like:



>: cat /etc/resolv.conf
nameserver 8.8.8.8


but I can ping my gateway so the default route seems okay:



>: ip r
default via 192.168.1.1 dev eth0 onlink
192.168.1.0/24 dev eth0 proto kernel scope link src 192.168.1.10


my /etc/nsswitch.conf says:



hosts:          files dns
networks: files


What is missing? Should I be doing something else in Stretch?










share|improve this question
















bumped to the homepage by Community 27 mins ago


This question has answers that may be good or bad; the system has marked it active so that they can be reviewed.
















  • Please show grep hosts /etc/nsswitch.conf in your question

    – roaima
    Nov 15 '17 at 23:29
















0















I have configured Stretch networking for eth0 (it picked ens3), after setting:



GRUB_CMDLINE_LINUX="net.ifnames=0 biosdevname=0"
grub-mkconfig -o /boot/grub/grub.cfg
reboot


so now I have:



>: cat /etc/network/interfaces
source /etc/network/interfaces.d/*

# The loopback network interface
auto lo
iface lo inet loopback

# The primary network interface
allow-hotplug eth0
iface eth0 inet static
address 192.168.1.10/24
gateway 192.168.1.1
# dns-* options are implemented by the resolvconf package, if installed
dns-nameservers 8.8.8.8


which works, so:



>: ip a
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN group default qlen 1
link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
inet 127.0.0.1/8 scope host lo
valid_lft forever preferred_lft forever
inet6 ::1/128 scope host
valid_lft forever preferred_lft forever
2: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP group default qlen 1000
link/ether 52:54:00:0a:f7:bc brd ff:ff:ff:ff:ff:ff
inet 192.168.1.10/24 brd 192.168.1.255 scope global eth0
valid_lft forever preferred_lft forever
inet6 fe80::5054:ff:fe0a:f7bc/64 scope link
valid_lft forever preferred_lft forever


And I can ping google nameservers like:



>: ping 8.8.8.8
PING 8.8.8.8 (8.8.8.8) 56(84) bytes of data.
64 bytes from 8.8.8.8: icmp_seq=1 ttl=55 time=10.9 ms
64 bytes from 8.8.8.8: icmp_seq=2 ttl=55 time=10.9 ms


But not google itself, or any other domain. My hosts file looks like:



>: cat /etc/hosts
127.0.0.1 localhost
192.168.1.10 someserver.name.com someserver

# The following lines are desirable for IPv6 capable hosts
::1 localhost ip6-localhost ip6-loopback
ff02::1 ip6-allnodes
ff02::2 ip6-allrouters


My resolv.conf looks like:



>: cat /etc/resolv.conf
nameserver 8.8.8.8


but I can ping my gateway so the default route seems okay:



>: ip r
default via 192.168.1.1 dev eth0 onlink
192.168.1.0/24 dev eth0 proto kernel scope link src 192.168.1.10


my /etc/nsswitch.conf says:



hosts:          files dns
networks: files


What is missing? Should I be doing something else in Stretch?










share|improve this question
















bumped to the homepage by Community 27 mins ago


This question has answers that may be good or bad; the system has marked it active so that they can be reviewed.
















  • Please show grep hosts /etc/nsswitch.conf in your question

    – roaima
    Nov 15 '17 at 23:29














0












0








0








I have configured Stretch networking for eth0 (it picked ens3), after setting:



GRUB_CMDLINE_LINUX="net.ifnames=0 biosdevname=0"
grub-mkconfig -o /boot/grub/grub.cfg
reboot


so now I have:



>: cat /etc/network/interfaces
source /etc/network/interfaces.d/*

# The loopback network interface
auto lo
iface lo inet loopback

# The primary network interface
allow-hotplug eth0
iface eth0 inet static
address 192.168.1.10/24
gateway 192.168.1.1
# dns-* options are implemented by the resolvconf package, if installed
dns-nameservers 8.8.8.8


which works, so:



>: ip a
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN group default qlen 1
link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
inet 127.0.0.1/8 scope host lo
valid_lft forever preferred_lft forever
inet6 ::1/128 scope host
valid_lft forever preferred_lft forever
2: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP group default qlen 1000
link/ether 52:54:00:0a:f7:bc brd ff:ff:ff:ff:ff:ff
inet 192.168.1.10/24 brd 192.168.1.255 scope global eth0
valid_lft forever preferred_lft forever
inet6 fe80::5054:ff:fe0a:f7bc/64 scope link
valid_lft forever preferred_lft forever


And I can ping google nameservers like:



>: ping 8.8.8.8
PING 8.8.8.8 (8.8.8.8) 56(84) bytes of data.
64 bytes from 8.8.8.8: icmp_seq=1 ttl=55 time=10.9 ms
64 bytes from 8.8.8.8: icmp_seq=2 ttl=55 time=10.9 ms


But not google itself, or any other domain. My hosts file looks like:



>: cat /etc/hosts
127.0.0.1 localhost
192.168.1.10 someserver.name.com someserver

# The following lines are desirable for IPv6 capable hosts
::1 localhost ip6-localhost ip6-loopback
ff02::1 ip6-allnodes
ff02::2 ip6-allrouters


My resolv.conf looks like:



>: cat /etc/resolv.conf
nameserver 8.8.8.8


but I can ping my gateway so the default route seems okay:



>: ip r
default via 192.168.1.1 dev eth0 onlink
192.168.1.0/24 dev eth0 proto kernel scope link src 192.168.1.10


my /etc/nsswitch.conf says:



hosts:          files dns
networks: files


What is missing? Should I be doing something else in Stretch?










share|improve this question
















I have configured Stretch networking for eth0 (it picked ens3), after setting:



GRUB_CMDLINE_LINUX="net.ifnames=0 biosdevname=0"
grub-mkconfig -o /boot/grub/grub.cfg
reboot


so now I have:



>: cat /etc/network/interfaces
source /etc/network/interfaces.d/*

# The loopback network interface
auto lo
iface lo inet loopback

# The primary network interface
allow-hotplug eth0
iface eth0 inet static
address 192.168.1.10/24
gateway 192.168.1.1
# dns-* options are implemented by the resolvconf package, if installed
dns-nameservers 8.8.8.8


which works, so:



>: ip a
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN group default qlen 1
link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
inet 127.0.0.1/8 scope host lo
valid_lft forever preferred_lft forever
inet6 ::1/128 scope host
valid_lft forever preferred_lft forever
2: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP group default qlen 1000
link/ether 52:54:00:0a:f7:bc brd ff:ff:ff:ff:ff:ff
inet 192.168.1.10/24 brd 192.168.1.255 scope global eth0
valid_lft forever preferred_lft forever
inet6 fe80::5054:ff:fe0a:f7bc/64 scope link
valid_lft forever preferred_lft forever


And I can ping google nameservers like:



>: ping 8.8.8.8
PING 8.8.8.8 (8.8.8.8) 56(84) bytes of data.
64 bytes from 8.8.8.8: icmp_seq=1 ttl=55 time=10.9 ms
64 bytes from 8.8.8.8: icmp_seq=2 ttl=55 time=10.9 ms


But not google itself, or any other domain. My hosts file looks like:



>: cat /etc/hosts
127.0.0.1 localhost
192.168.1.10 someserver.name.com someserver

# The following lines are desirable for IPv6 capable hosts
::1 localhost ip6-localhost ip6-loopback
ff02::1 ip6-allnodes
ff02::2 ip6-allrouters


My resolv.conf looks like:



>: cat /etc/resolv.conf
nameserver 8.8.8.8


but I can ping my gateway so the default route seems okay:



>: ip r
default via 192.168.1.1 dev eth0 onlink
192.168.1.0/24 dev eth0 proto kernel scope link src 192.168.1.10


my /etc/nsswitch.conf says:



hosts:          files dns
networks: files


What is missing? Should I be doing something else in Stretch?







debian networking






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited Nov 16 '17 at 1:04







batflaps

















asked Nov 15 '17 at 23:26









batflapsbatflaps

285




285





bumped to the homepage by Community 27 mins ago


This question has answers that may be good or bad; the system has marked it active so that they can be reviewed.







bumped to the homepage by Community 27 mins ago


This question has answers that may be good or bad; the system has marked it active so that they can be reviewed.















  • Please show grep hosts /etc/nsswitch.conf in your question

    – roaima
    Nov 15 '17 at 23:29



















  • Please show grep hosts /etc/nsswitch.conf in your question

    – roaima
    Nov 15 '17 at 23:29

















Please show grep hosts /etc/nsswitch.conf in your question

– roaima
Nov 15 '17 at 23:29





Please show grep hosts /etc/nsswitch.conf in your question

– roaima
Nov 15 '17 at 23:29










2 Answers
2






active

oldest

votes


















0














It sounds like you may be confusing two issues routing and DNS.
If you are able to ping numerical addresses, like <8.8.8.8> or <128.171.224.100> (www.hawaii.edu) then the issue is DNS, not routing.



The /etc/nsswitch.conf file specifies where to look for DNS information, and in what order to make the queries. Look for the line strating with 'hosts'.






share|improve this answer
























  • I wanted to verify routing before chasing down DNS issues. my /etc/nsswitch.conf says hosts: files dns.

    – batflaps
    Nov 16 '17 at 0:30











  • I ran host google.com and it returned google.com has address 216.58.193.78 so that works. I tried disabling ipv6 too (someone said that helped) but it didn't help.

    – batflaps
    Nov 16 '17 at 0:37



















0














# The primary network interface
allow-hotplug eth0
iface eth0 inet static
address 192.168.1.10/24
gateway 192.168.1.1
# dns-* options are implemented by the resolvconf package, if installed
dns-nameservers 8.8.8.8


Remove the /24.
Reasons for this:
Syntax wise you're incorrect.



Assuming your 192.168.1.10 address contains a DNS server, removing the /24 should fix your error.






share|improve this answer


























  • the /24 was put there by Stretch installer. I removed the CIDR and put netmask 255.255.255.0 on the next line like Jessie, and it didn't help. The output of ip a is still the same, and looks right or routing wouldn't work I think.

    – batflaps
    Nov 16 '17 at 0:41











  • The CIDR syntax is accepted since wheezy at least. And the OP clearly does not run a resolver on the host.

    – Ferenc Wágner
    Nov 21 '17 at 14:58













Your Answer








StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "106"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);

StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});

function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: false,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: null,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});


}
});














draft saved

draft discarded


















StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f404883%2fdebian-stretch-wont-resolve-hostname-but-ip-works%23new-answer', 'question_page');
}
);

Post as a guest















Required, but never shown

























2 Answers
2






active

oldest

votes








2 Answers
2






active

oldest

votes









active

oldest

votes






active

oldest

votes









0














It sounds like you may be confusing two issues routing and DNS.
If you are able to ping numerical addresses, like <8.8.8.8> or <128.171.224.100> (www.hawaii.edu) then the issue is DNS, not routing.



The /etc/nsswitch.conf file specifies where to look for DNS information, and in what order to make the queries. Look for the line strating with 'hosts'.






share|improve this answer
























  • I wanted to verify routing before chasing down DNS issues. my /etc/nsswitch.conf says hosts: files dns.

    – batflaps
    Nov 16 '17 at 0:30











  • I ran host google.com and it returned google.com has address 216.58.193.78 so that works. I tried disabling ipv6 too (someone said that helped) but it didn't help.

    – batflaps
    Nov 16 '17 at 0:37
















0














It sounds like you may be confusing two issues routing and DNS.
If you are able to ping numerical addresses, like <8.8.8.8> or <128.171.224.100> (www.hawaii.edu) then the issue is DNS, not routing.



The /etc/nsswitch.conf file specifies where to look for DNS information, and in what order to make the queries. Look for the line strating with 'hosts'.






share|improve this answer
























  • I wanted to verify routing before chasing down DNS issues. my /etc/nsswitch.conf says hosts: files dns.

    – batflaps
    Nov 16 '17 at 0:30











  • I ran host google.com and it returned google.com has address 216.58.193.78 so that works. I tried disabling ipv6 too (someone said that helped) but it didn't help.

    – batflaps
    Nov 16 '17 at 0:37














0












0








0







It sounds like you may be confusing two issues routing and DNS.
If you are able to ping numerical addresses, like <8.8.8.8> or <128.171.224.100> (www.hawaii.edu) then the issue is DNS, not routing.



The /etc/nsswitch.conf file specifies where to look for DNS information, and in what order to make the queries. Look for the line strating with 'hosts'.






share|improve this answer













It sounds like you may be confusing two issues routing and DNS.
If you are able to ping numerical addresses, like <8.8.8.8> or <128.171.224.100> (www.hawaii.edu) then the issue is DNS, not routing.



The /etc/nsswitch.conf file specifies where to look for DNS information, and in what order to make the queries. Look for the line strating with 'hosts'.







share|improve this answer












share|improve this answer



share|improve this answer










answered Nov 16 '17 at 0:01









TobyToby

262




262













  • I wanted to verify routing before chasing down DNS issues. my /etc/nsswitch.conf says hosts: files dns.

    – batflaps
    Nov 16 '17 at 0:30











  • I ran host google.com and it returned google.com has address 216.58.193.78 so that works. I tried disabling ipv6 too (someone said that helped) but it didn't help.

    – batflaps
    Nov 16 '17 at 0:37



















  • I wanted to verify routing before chasing down DNS issues. my /etc/nsswitch.conf says hosts: files dns.

    – batflaps
    Nov 16 '17 at 0:30











  • I ran host google.com and it returned google.com has address 216.58.193.78 so that works. I tried disabling ipv6 too (someone said that helped) but it didn't help.

    – batflaps
    Nov 16 '17 at 0:37

















I wanted to verify routing before chasing down DNS issues. my /etc/nsswitch.conf says hosts: files dns.

– batflaps
Nov 16 '17 at 0:30





I wanted to verify routing before chasing down DNS issues. my /etc/nsswitch.conf says hosts: files dns.

– batflaps
Nov 16 '17 at 0:30













I ran host google.com and it returned google.com has address 216.58.193.78 so that works. I tried disabling ipv6 too (someone said that helped) but it didn't help.

– batflaps
Nov 16 '17 at 0:37





I ran host google.com and it returned google.com has address 216.58.193.78 so that works. I tried disabling ipv6 too (someone said that helped) but it didn't help.

– batflaps
Nov 16 '17 at 0:37













0














# The primary network interface
allow-hotplug eth0
iface eth0 inet static
address 192.168.1.10/24
gateway 192.168.1.1
# dns-* options are implemented by the resolvconf package, if installed
dns-nameservers 8.8.8.8


Remove the /24.
Reasons for this:
Syntax wise you're incorrect.



Assuming your 192.168.1.10 address contains a DNS server, removing the /24 should fix your error.






share|improve this answer


























  • the /24 was put there by Stretch installer. I removed the CIDR and put netmask 255.255.255.0 on the next line like Jessie, and it didn't help. The output of ip a is still the same, and looks right or routing wouldn't work I think.

    – batflaps
    Nov 16 '17 at 0:41











  • The CIDR syntax is accepted since wheezy at least. And the OP clearly does not run a resolver on the host.

    – Ferenc Wágner
    Nov 21 '17 at 14:58


















0














# The primary network interface
allow-hotplug eth0
iface eth0 inet static
address 192.168.1.10/24
gateway 192.168.1.1
# dns-* options are implemented by the resolvconf package, if installed
dns-nameservers 8.8.8.8


Remove the /24.
Reasons for this:
Syntax wise you're incorrect.



Assuming your 192.168.1.10 address contains a DNS server, removing the /24 should fix your error.






share|improve this answer


























  • the /24 was put there by Stretch installer. I removed the CIDR and put netmask 255.255.255.0 on the next line like Jessie, and it didn't help. The output of ip a is still the same, and looks right or routing wouldn't work I think.

    – batflaps
    Nov 16 '17 at 0:41











  • The CIDR syntax is accepted since wheezy at least. And the OP clearly does not run a resolver on the host.

    – Ferenc Wágner
    Nov 21 '17 at 14:58
















0












0








0







# The primary network interface
allow-hotplug eth0
iface eth0 inet static
address 192.168.1.10/24
gateway 192.168.1.1
# dns-* options are implemented by the resolvconf package, if installed
dns-nameservers 8.8.8.8


Remove the /24.
Reasons for this:
Syntax wise you're incorrect.



Assuming your 192.168.1.10 address contains a DNS server, removing the /24 should fix your error.






share|improve this answer















# The primary network interface
allow-hotplug eth0
iface eth0 inet static
address 192.168.1.10/24
gateway 192.168.1.1
# dns-* options are implemented by the resolvconf package, if installed
dns-nameservers 8.8.8.8


Remove the /24.
Reasons for this:
Syntax wise you're incorrect.



Assuming your 192.168.1.10 address contains a DNS server, removing the /24 should fix your error.







share|improve this answer














share|improve this answer



share|improve this answer








edited Nov 16 '17 at 0:35









G-Man

13k93365




13k93365










answered Nov 16 '17 at 0:29









Anthony RiosAnthony Rios

1




1













  • the /24 was put there by Stretch installer. I removed the CIDR and put netmask 255.255.255.0 on the next line like Jessie, and it didn't help. The output of ip a is still the same, and looks right or routing wouldn't work I think.

    – batflaps
    Nov 16 '17 at 0:41











  • The CIDR syntax is accepted since wheezy at least. And the OP clearly does not run a resolver on the host.

    – Ferenc Wágner
    Nov 21 '17 at 14:58





















  • the /24 was put there by Stretch installer. I removed the CIDR and put netmask 255.255.255.0 on the next line like Jessie, and it didn't help. The output of ip a is still the same, and looks right or routing wouldn't work I think.

    – batflaps
    Nov 16 '17 at 0:41











  • The CIDR syntax is accepted since wheezy at least. And the OP clearly does not run a resolver on the host.

    – Ferenc Wágner
    Nov 21 '17 at 14:58



















the /24 was put there by Stretch installer. I removed the CIDR and put netmask 255.255.255.0 on the next line like Jessie, and it didn't help. The output of ip a is still the same, and looks right or routing wouldn't work I think.

– batflaps
Nov 16 '17 at 0:41





the /24 was put there by Stretch installer. I removed the CIDR and put netmask 255.255.255.0 on the next line like Jessie, and it didn't help. The output of ip a is still the same, and looks right or routing wouldn't work I think.

– batflaps
Nov 16 '17 at 0:41













The CIDR syntax is accepted since wheezy at least. And the OP clearly does not run a resolver on the host.

– Ferenc Wágner
Nov 21 '17 at 14:58







The CIDR syntax is accepted since wheezy at least. And the OP clearly does not run a resolver on the host.

– Ferenc Wágner
Nov 21 '17 at 14:58




















draft saved

draft discarded




















































Thanks for contributing an answer to Unix & Linux Stack Exchange!


  • Please be sure to answer the question. Provide details and share your research!

But avoid



  • Asking for help, clarification, or responding to other answers.

  • Making statements based on opinion; back them up with references or personal experience.


To learn more, see our tips on writing great answers.




draft saved


draft discarded














StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f404883%2fdebian-stretch-wont-resolve-hostname-but-ip-works%23new-answer', 'question_page');
}
);

Post as a guest















Required, but never shown





















































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown

































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown







Popular posts from this blog

サソリ

広島県道265号伴広島線

Setup Asymptote in Texstudio