Git Product home page Git Product logo

Comments (4)

g23guy avatar g23guy commented on July 20, 2024

How do we get the domain? The hostname -d command will print it out, but only if the /etc/hosts has been updated correctly with the domain information. Is there any other way to determine server's domain?

from supportutils.

jirib avatar jirib commented on July 20, 2024

Hm, what about this?

domain=$(hostnamectl status | grep -Po '^\s*Static hostname: [^\.]+\.\K(.*)')
[[ -n ${domain} ]] && dig +noall +answer ${domain}. SOA
suse.de.  300  IN  SOA  dns1.suse.de.  infra.suse.de.  2021072802  3600  7200  3024000  300

It's probably nonsense as each subdomain doesn't need to have a separate delegation (ie. SOA record). Maybe this?

myhost=$(hostnamectl status | grep -Po '^ *Static hostname: \K([[:alnum:]\.-]+)')
dig ${myhost}.

from supportutils.

g23guy avatar g23guy commented on July 20, 2024

I looked at this again, but hostnamectl does not get a domain name on my SLES15 SP3 server. It appears it's not configured unless the /etc/hosts is updated. I suppose we could ping suse.com, but then that might not be valid since some server won't have external access. I supposed supportconfig would have to check if it's own FQDN is configured in /etc/hosts and then ping it if found.

from supportutils.

jirib avatar jirib commented on July 20, 2024

I came to conclution this is odd feature request. Thx anyway.

from supportutils.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.