SnapOverflow

SnapOverflow Logo SnapOverflow Logo

SnapOverflow Navigation

  • Home
  • Server
  • Ubuntu

Mobile menu

Close
  • Home
  • System Administrators
    • Hot Questions
    • New Questions
    • Tags
  • Ubuntu
    • Hot Questions
    • New Questions
    • Tags
  • Help
Home / user-4634

grigoryvp's questions

Martin Hope
grigoryvp
Asked: 2014-09-20 01:28:00 +0800 CST

How to correctly configure DNS usage in Ubuntu? Authoritative answers without RA flag are ignored

  • 5

I have latest clean Ubuntu 14.04.1 64-bit from official website installed in Virtualbox. I connect to a VPN network using vpnc that sets 2 DNS servers using DHCP:

user@virtual:~$ 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 10.88.94.1
nameserver 8.8.8.8
nameserver 10.40.0.1

Where 10.88.94.1 and 8.8.8.8 are returned by vpn dhcp and 10.40.0.1 is returned by lan dhcp. The first DNS server returned by vpn dhcp is configured as authoritative, non-recursive name server for some internal names.

The problem is - Ubuntu somehow ignores the authoritative flag and discard valid response becouse it's non-recursive:

user@virtual:~$ nslookup
> video.something.com
;; Got recursion not available from 10.88.94.1, trying next server
Server:     8.8.8.8
Address:    8.8.8.8#53

Non-authoritative answer:
Name:   video.something.com
Address: 180.112.94.1

As tcpdump clearly shows the answer from first DNS server have 'authoritative' flag set, but somehow it is ignored ('*' in second response is for "authoritative", '-' is for "non-recursive"):

13:23:44.505098 IP 10.40.130.209.44159 > 10.88.94.1.domain: 63790+ A? video.something.com. (32)
13:23:44.506285 IP 10.88.94.1.domain > 10.40.130.209.44159: 63790*- 1/0/0 A 10.88.94.12 (48)
13:23:44.506390 IP 10.40.130.209.45437 > 8.8.8.8.domain: 63790+ A? video.something.com. (32)
13:23:44.608414 IP 8.8.8.8.domain > 10.40.130.209.45437: 63790 1/0/0 A 180.112.94.1 (48)

Same setup works as expected (first DNS result is used) on both Windows and OSX. But not on Ubuntu. Is it something i can fix in Ubuntu in order for authoritative responses to be processed crrectly regardless of "non-recursive" flag or it is completely broken and where is nothing i can do?

ubuntu
  • 2 Answers
  • 2896 Views
Martin Hope
grigoryvp
Asked: 2013-01-29 22:44:21 +0800 CST

Is it possible to get zombie process exit status from shell?

  • 3

If i execute 'ps' command in shell, i can get some processes marked as '' - they are exited, but parent process don't receive they exit status yet. Sometimes, while debugging network apps, i need to get exit status of such process from shell - is it 0 or some error code like segmentation fault?

Is it possible to get this exit status from shell given PID, or only zombie's parent process can get this exit status?

P.S. I don't need to "kill" them, "close" them etc. I only need to check they exit status :)

process
  • 2 Answers
  • 1961 Views
Martin Hope
grigoryvp
Asked: 2012-12-29 10:04:18 +0800 CST

How to route external TCP port 80 into loopback (127.0.0.1) port 8080?

  • 3

I have a test VDS box with real IP. If i start web server on physical interface port 80, it can be opened from another computer via it's ip address (and default port 80):

python -m SimpleHTTPServer 80

But if i try to reditect port 80 from physical interface eth0 to loopback 127.0.0.1 port 8080 i can connect it from another computer on port 8080, but can't connect on port 80, it's just endless 'connecting'. Seems like no redirection occurs:

iptables -t nat -A PREROUTING -i eth0 -p tcp --dport 80 -j DNAT --to-destination 127.0.0.1:8080
python -m SimpleHTTPServer 8080

What i'm doing wrong? :(

P.S. Binding server on '127.0.0.1:8080' produce same result, but it does not matter since server running on '0.0.0.0:8080' will accept connection redirected to '127.0.0.1:8080'. AFAIK. :(

iptables -L result:

Chain INPUT (policy ACCEPT)
target     prot opt source               destination         

Chain FORWARD (policy ACCEPT)
target     prot opt source               destination         

Chain OUTPUT (policy ACCEPT)
target     prot opt source               destination

iptables -t nat -L result:

Chain PREROUTING (policy ACCEPT)
target     prot opt source               destination         
DNAT       tcp  --  anywhere             anywhere             tcp dpt:http to:127.0.0.1:8080

Chain INPUT (policy ACCEPT)
target     prot opt source               destination         

Chain OUTPUT (policy ACCEPT)
target     prot opt source               destination         

Chain POSTROUTING (policy ACCEPT)
target     prot opt source               destination

netstat -nlp result:

Active Internet connections (only servers)
Proto Recv-Q Send-Q Local Address           Foreign Address         State       PID/Program name
tcp        0      0 0.0.0.0:22              0.0.0.0:*               LISTEN      676/sshd        
tcp6       0      0 :::22                   :::*                    LISTEN      676/sshd        
Active UNIX domain sockets (only servers)
Proto RefCnt Flags       Type       State         I-Node   PID/Program name    Path
unix  2      [ ACC ]     STREAM     LISTENING     7964     600/acpid           /var/run/acpid.socket
unix  2      [ ACC ]     STREAM     LISTENING     6590     1/init              @/com/ubuntu/upstart
unix  2      [ ACC ]     SEQPACKET  LISTENING     6760     231/udevd           /run/udev/control
unix  2      [ ACC ]     STREAM     LISTENING     7030     345/dbus-daemon     /var/run/dbus/system_bus_socket

ifconfig -a result:

eth0      Link encap:Ethernet  HWaddr 00:16:3e:da:1a:98  
          inet addr:5.14.223.181  Bcast:5.14.223.255  Mask:255.255.255.0
          inet6 addr: fe80::140:3eff:febe:201a/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:371264 errors:0 dropped:59 overruns:0 frame:0
          TX packets:2093 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000 
          RX bytes:17377545 (17.3 MB)  TX bytes:214428 (214.4 KB)
          Interrupt:25 

lo        Link encap:Local Loopback  
          inet addr:127.0.0.1  Mask:255.0.0.0
          inet6 addr: ::1/128 Scope:Host
          UP LOOPBACK RUNNING  MTU:16436  Metric:1
          RX packets:10 errors:0 dropped:0 overruns:0 frame:0
          TX packets:10 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0 
          RX bytes:552 (552.0 B)  TX bytes:552 (552.0 B)
linux
  • 4 Answers
  • 15604 Views
Martin Hope
grigoryvp
Asked: 2011-03-05 07:36:40 +0800 CST

How does Windows resolve hostnames without DNS?

  • 7

I have a Windows 7 computer and a MacOS X 10.6 computer that are connected to the same LAN using a 10$ hub. On MacOS I set the computer name to "mymac.local" in "preferences->sharing". The Windows computer has a static IP address of 192.168.0.10 and the Mac has the address 192.168.0.20. Both have a netmask of 255.255.255.0 and no gateway.

If I issue the command ping mymac.local from my Windows computer it will successfully ping 192.168.0.20. How did Windows determine that IP 192.168.0.20 is associated with "mymac.local" since there's no DNS on my network? Is it some broadcast? What protocol is used?

windows mac-osx hostname
  • 3 Answers
  • 12575 Views
Martin Hope
grigoryvp
Asked: 2010-12-30 01:15:56 +0800 CST

How to check TCP timeout in linux / macos?

  • 15

I have a network problem on my MacOS that i need to troubleshoot. I know that TCP socket has internal timeout that will close connection if remote party is not responding (but no graceful disconnect either). Is it any command/tool i can use to check exact value of this timeout(s)?

mac-osx tcp
  • 4 Answers
  • 60045 Views
Martin Hope
grigoryvp
Asked: 2010-04-09 02:22:10 +0800 CST

How to check sshd log?

  • 184

I have Ubuntu 9.10 installed with sshd and I can successfully connect to it using login and password. I have configured an RSA key login and now have "Server refused our key" as expected. Ok, now I want to check sshd log in order to figure out a problem. I have examined /etc/ssh/sshd_config and it have

SyslogFacility AUTH
LogLevel INFO

Ok. I'm looking at /var/log/auth.log and... it's empty O_O. Changing Loglevel to VERBOSE helps nothing - auth.log is still empty. Any hints how I can check sshd log?

ssh
  • 8 Answers
  • 850173 Views
Martin Hope
grigoryvp
Asked: 2009-10-16 04:43:40 +0800 CST

How to create a VHD file from a folder?

  • 6

Is it a way to create a VHD virtual drive image from files in existing folder? I know that it can be done programmatically via .NET framework API, but maybe it's already exists a tool that can be run like

create my.vhd c:\my
vhd
  • 4 Answers
  • 20047 Views
Martin Hope
grigoryvp
Asked: 2009-09-21 06:27:44 +0800 CST

Windows desktop search other than google desktop?

  • 3

As a developer, i frequently need to perform complex searches for files. For example, search for file that starts with 'buf' and ends with '.c' or '.h' in a c:\sdk and c:\project\include. Windows search in vista+ is good, but for a lrage amount of sources it will search VERY long time if not index, and it's not possible to specify a number of folders to search in.

Is it any good and freeware tool available that allows to perform complex file search on windows platform? Google desktop requires indexing too and regexp support is very limited.

search
  • 3 Answers
  • 261 Views
Martin Hope
grigoryvp
Asked: 2009-08-26 08:02:25 +0800 CST

Where to find symmetric NAT?

  • 5

Currently i'm working on some NAT traversal code (that allows to computers each behind it's own NAT to communicate with each other). But, surprisingly, i can't find any symmetric NAT's! (it's the most hard case). Anyone knows where can i find one, wither in software or hardware? It seems that windows 'internet connection sharing' is not symmetric :(.

nat
  • 2 Answers
  • 2075 Views
Martin Hope
grigoryvp
Asked: 2009-07-08 00:49:49 +0800 CST

How to correctly install Subversion in Mac OS X?

  • 5

A task has emerged to install latest subversion for a group of mac os x users (latest mac os version). I have tried first to install it manually from subversion.tigris.org, 'opencollabnet binary' (http://downloads.open.collab.net/binaries.html, "Universal Subversion 1.6.3 Binaries for MAC OS X (32 and 64 bit)"). It installed ok via .pkg installer, but after using 'svn' command I was surprised to see an old 1.4.4 version bundled with macos.

It seems, that installing new subversion does not replace an old one. What is a 'correct' way to ensure that 'svn' command always uses newly installed subversion? I can create a symlink or add /opt/bla-bla-bla/subversion to path, but I'm afraid that such crude hacking can break something.

mac-osx svn
  • 2 Answers
  • 2054 Views
Martin Hope
grigoryvp
Asked: 2009-06-23 04:47:00 +0800 CST

Download file from vbscript?

  • 5

I need a script that can be run on freshly installed windows xp+ and download specified files from internet, like http://www.python.org/ftp/python/2.6.2/python-2.6.2.msi Is it any easy way to do it without hand-crafting HTTP/FTP requests or using third-party programs like wget? I can suggest that WScript.CreateObject("internetexplorer.application") will do the magic, but documentation on it is extremely huge and Google is silent, as always :).

vbscript
  • 4 Answers
  • 37258 Views
Martin Hope
grigoryvp
Asked: 2009-06-23 02:53:08 +0800 CST

Crossplatform way to check admin rights in python script?

  • 3

Is it any cross-platform way to check that my python script is executed under admin rights? Unfortunately, os.getuid() is UNIX-only and is not available under windows :(.

python
  • 2 Answers
  • 1972 Views
Martin Hope
grigoryvp
Asked: 2009-06-23 00:47:43 +0800 CST

Can vim execute buffer without addons?

  • 3

If editing some script in vim, a file with .py or .sh extension, is it any build-in vim command that allows to run such file? I know it's a lot of IDE-like addons for VIM that allows to execute files vim edit, but is it possible without addons?

vim vi
  • 1 Answers
  • 1182 Views
Martin Hope
grigoryvp
Asked: 2009-06-22 09:33:33 +0800 CST

Make DVD image in Mac OS X without third-party tools?

  • 4

Is there any way in Mac OS X 10.5.x to create a .dmg image from existing physical DVD, without a third-party tools installation? I have carefully examined "disk utility" and searched Google, but it seems that all people just write .dmg files, no information on how to create them from physical DVD disks.

mac-osx optical-media
  • 4 Answers
  • 9826 Views
Martin Hope
grigoryvp
Asked: 2009-06-19 02:17:23 +0800 CST

Configure vim for text selection with shift and copy/paste via ctrl+c, ctrl+v?

  • 13

Many machines i need to work with have basic NIX installation with vim as text editor. But vim's way to select text is kind of unusual to me :). Is it any easy way to re-configure vim so it will use shift in order to select text and ctrl+c / ctrl+v for copy and paste?

vim
  • 1 Answers
  • 8200 Views
Martin Hope
grigoryvp
Asked: 2009-06-02 10:29:00 +0800 CST

install .app file on MacOS via script?

  • 5

I have an .app executable generated for MacOSX. Is it any easy way to install this app into Applications so it can be used by end users, via script? (need to install on multiple computers and really don't want to create intermediate .pkg installer for it)

mac-osx installation application
  • 1 Answers
  • 1494 Views
Martin Hope
grigoryvp
Asked: 2009-06-02 05:03:25 +0800 CST

check admin rights inside python script

  • 15

How to check that my python script is running under Administrator rights (sudo) under BSD-like OS? Need to display user-friendly warning in order it is executed without admin rights.

python sudo
  • 3 Answers
  • 18975 Views
Martin Hope
grigoryvp
Asked: 2009-05-30 01:41:30 +0800 CST

ping alternative for tcp?

  • 12
Locked. This question and its answers are locked because the question is off-topic but has historical significance. It is not currently accepting new answers or interactions.

It's a common task to check network 'quality' - latency, number of dropped packets etc. But 'ping' has a number of drawbacks: - It uses ICMP. Many ISP has different shapers for ICMP and TCP traffic, so 'ping' will show 10ms latency, but TCP connections will experience 1000ms+. - It sends very small amount of packets. By default, one packet every second. Since TCP protocol tolerates packets loss (it can operate very well is half packets are lost - it's normal), it's absolutely unclear if ping's "30% packet loss" killing connection or if it's absolutely normal.

So, is it any alternative for ping that use TCP connection instead of ICMP and checks internet connection quality?

networking tcp
  • 9 Answers
  • 119133 Views
Martin Hope
grigoryvp
Asked: 2009-05-29 01:01:33 +0800 CST

how to silently install .dmg in MacOS?

  • 9

I have a .dmg MacOS package (with 'continue' buttons, EULA etc) that i need to install on multiple computers. Is it a way to do so silently via a bash/python/ruby/etc script just like silent MSI installation in Windows? I can automate installation writing script that will click buttons for me, but that looks kinda unnatural :).

mac-osx installation
  • 4 Answers
  • 24504 Views
Martin Hope
grigoryvp
Asked: 2009-05-28 22:01:34 +0800 CST

how to get process file name from PID in MacOS?

  • 14

Is it possible to get a file name of a process using PID? ps displays a lot of useful information about a process, but not a hint about a process executable file location.

mac-osx process pid
  • 5 Answers
  • 32017 Views

Sidebar

Stats

  • Questions 681965
  • Answers 980273
  • Best Answers 280204
  • Users 287326
  • Popular
  • Answers
  • Marko Smith

    Can you pass user/pass for HTTP Basic Authentication in URL parameters?

    • 5 Answers
  • Marko Smith

    Ping a Specific Port

    • 18 Answers
  • Marko Smith

    Check if port is open or closed on a Linux server?

    • 7 Answers
  • Marko Smith

    How to automate SSH login with password?

    • 10 Answers
  • Marko Smith

    How do I tell Git for Windows where to find my private RSA key?

    • 30 Answers
  • Marko Smith

    What's the default superuser username/password for postgres after a new install?

    • 5 Answers
  • Marko Smith

    What port does SFTP use?

    • 6 Answers
  • Marko Smith

    Command line to list users in a Windows Active Directory group?

    • 9 Answers
  • Marko Smith

    What is a Pem file and how does it differ from other OpenSSL Generated Key File Formats?

    • 3 Answers
  • Marko Smith

    How to determine if a bash variable is empty?

    • 15 Answers
  • Martin Hope
    Davie Ping a Specific Port 2009-10-09 01:57:50 +0800 CST
  • Martin Hope
    Smudge Our security auditor is an idiot. How do I give him the information he wants? 2011-07-23 14:44:34 +0800 CST
  • Martin Hope
    kernel Can scp copy directories recursively? 2011-04-29 20:24:45 +0800 CST
  • Martin Hope
    Robert ssh returns "Bad owner or permissions on ~/.ssh/config" 2011-03-30 10:15:48 +0800 CST
  • Martin Hope
    Eonil How to automate SSH login with password? 2011-03-02 03:07:12 +0800 CST
  • Martin Hope
    gunwin How do I deal with a compromised server? 2011-01-03 13:31:27 +0800 CST
  • Martin Hope
    Tom Feiner How can I sort du -h output by size 2009-02-26 05:42:42 +0800 CST
  • Martin Hope
    Noah Goodrich What is a Pem file and how does it differ from other OpenSSL Generated Key File Formats? 2009-05-19 18:24:42 +0800 CST
  • Martin Hope
    Brent How to determine if a bash variable is empty? 2009-05-13 09:54:48 +0800 CST
  • Martin Hope
    cletus How do you find what process is holding a file open in Windows? 2009-05-01 16:47:16 +0800 CST

Related Questions

Trending Tags

linux nginx windows networking ubuntu domain-name-system amazon-web-services active-directory apache-2.4 ssh

Explore

  • Home
  • Questions
    • Hot Questions
    • New Questions
  • Tags
  • Help

Footer

SnapOverflow

About Us

  • About Us
  • Contact Us

Legal Stuff

  • Privacy Policy

Help

© 2022 SOF-TR. All Rights Reserve